 |
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "Acts/Surfaces/PerigeeSurface.hpp"
14 #include "GaudiKernel/PhysicalConstants.h"
33 return StatusCode::SUCCESS;
39 ATH_MSG_VERBOSE(
"Run track finding in event "<<ctx.eventID().event_number());
45 allEventSegs.insert(allEventSegs.end(), partSegments->begin(), partSegments->end());
47 auto seedContainer =
findTrackSeeds(ctx, *allEventSegs.asDataVector());
51 const Acts::MagneticFieldContext mfContext =
m_extrapolationTool->getMagneticFieldContext(ctx);
55 Acts::VectorTrackContainer trackBackend;
56 Acts::VectorMultiTrajectory trackStateBackend;
58 std::move(trackBackend),
59 std::move(trackStateBackend)};
67 ATH_CHECK(writeHandle.record(std::move(seedContainer)));
68 return StatusCode::SUCCESS;
71 std::unique_ptr<MsTrackSeedContainer>
81 auto seedContainer = seeder.findTrackSeeds(ctx, segments);
89 const Acts::MagneticFieldContext& mfContext,
90 const Acts::CalibrationContext& calContext,
95 std::vector<const xAOD::UncalibratedMeasurement*> measurements{};
96 unsigned int nMeas = 2*
std::accumulate(seed.detailedSegments().begin(),
97 seed.detailedSegments().end(), 0,
99 return n + segment->measurements().size();
101 measurements.reserve(nMeas);
107 measurements.insert(measurements.end(),
108 std::make_move_iterator(segMeasuremnts.begin()),
109 std::make_move_iterator(segMeasuremnts.end()));
112 const Segment* innerSeg{seed.detailedSegments().front()};
115 const Amg::Vector3D refPos = innerSeg->position() - propDistance * innerSeg->direction();
116 auto target = Acts::Surface::makeShared<Acts::PerigeeSurface>(refPos);
118 Acts::ActsVector<4> fourPos{};
119 fourPos.block<3,1>(Acts::ePos0, 0) = refPos;
121 auto initialPars = Acts::BoundTrackParameters::create(tgContext,
target, fourPos,
122 innerSeg->direction(),
125 if (!initialPars.ok()) {
129 auto fitTraject =
m_trackFitTool->fit(measurements, *initialPars, tgContext, mfContext,calContext,
target.get());
133 auto destProxy = outContainer.getTrack(outContainer.addTrack());
134 destProxy.copyFrom(fitTraject->getTrack(0));
136 for (
const auto state : destProxy.trackStates()) {
137 if (!state.hasUncalibratedSourceLink()){
def retrieve(aClass, aKey=None)
std::vector< const xAOD::UncalibratedMeasurement * > collectMeasurements(const Segment &seg, bool skipOutlier=true)
Helper function to extract the measurements from the segment.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc to decode the Identifiers.
Acts::CalibrationContext getCalibrationContext(const EventContext &ctx)
The Acts::Calibration context is piped through the Acts fitters to (re)calibrate the Acts::SourceLink...
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
Gaudi::Property< double > m_seedHalfLength
Maximum search window to search segments for.
Gaudi::Property< std::string > m_writePrefix
Output track container prefix.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
DataVector adapter that acts like it holds const pointers.
virtual StatusCode execute(const EventContext &ctx) const override final
Standard algorithm execution hook.
Placeholder for what will later be the muon segment EDM representation.
Acts::TrackContainer< MutableTrackBackend, MutableTrackStateBackend, Acts::detail::ValueHolder > MutableTrackContainer
#define ATH_MSG_VERBOSE(x)
const MuonGMR4::MuonDetectorManager * m_detMgr
Pointer to the MuonDetectorManager.
StatusCode initialize(const std::string &prefix)
Sets up the handles.
static const xAOD::UncalibratedMeasurement * unpack(const Acts::SourceLink &sl)
Helper method to unpack an Acts source link to an uncalibrated measurement.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode initialize() override final
Standard algorithm hook to setup the extrapolator, retrieve the tools and declare algorithm's data de...
ToolHandle< IActsExtrapolationTool > m_extrapolationTool
Track extrapolation tool.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
ToolHandle< ActsTrk::IFitterTool > m_trackFitTool
Track fitting tool.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
::StatusCode StatusCode
StatusCode definition for legacy code.
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
Tracking geometry tool.
ActsTrk::MutableTrackContainerHandlesHelper m_trackContKeys
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
ToolHandle< ISegmentSelectionTool > m_segSelector
Segment selection tool to pick the good quality segments.
SG::WriteHandleKey< MsTrackSeedContainer > m_msTrkSeedKey
Temporary container write handle to push the seeds to store gate for later efficiency analysis.
double seedHalfLength
Maximum separation of point on the cylinder to be picked up onto a seed.
Helper class to group muon sgements that may belong to a muon trajectory.
Eigen::Matrix< double, 3, 1 > Vector3D
const Acts::Surface & muonSurface(const xAOD::UncalibratedMeasurement *meas)
Returns the associated Acts surface to the measurement.
This header ties the generic definitions in this package.
accumulate
Update flags based on parser line args.
#define ATH_MSG_WARNING(x)
DataVector adapter that acts like it holds const pointers.
std::unique_ptr< MsTrackSeedContainer > findTrackSeeds(const EventContext &ctx, const xAOD::MuonSegmentContainer &segments) const
Iterates over the search tree and combines close-by segments to a track seed.
SG::ReadHandleKeyArray< xAOD::MuonSegmentContainer > m_segmentKeys
Declare the data dependency on the standard Mdt+Rpc+Tgc segment container & on the NSW segment contai...
ToolHandle< MuonValR4::ITrackVisualizationTool > m_visualizationTool
Visualization tool to debug the track finding.
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
virtual ~MSTrackFindingAlg()
void fitSeedCandidate(const Acts::GeometryContext &gCtx, const Acts::MagneticFieldContext &mCtx, const Acts::CalibrationContext &cCtx, const MsTrackSeed &seed, ActsTrk::MutableTrackContainer &outContainer) const