ATLAS Offline Software
Loading...
Searching...
No Matches
MdtSegmentSeedGenerator.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
5
6
10
11#include <Acts/Utilities/Enumerate.hpp>
12#include <Acts/Definitions/Units.hpp>
13#include <Acts/Utilities/UnitVectors.hpp>
14
15#include <format>
16
17using namespace Acts;
18using namespace Acts::UnitLiterals;
19namespace MuonR4::SegmentFit{
22
24 const ISpacePointCalibrator* calibrator,
25 const bool calibratePull):
26 SpacePointPerLayerSplitter{parentSeed->getHitsInMax()},
27 m_parent{parentSeed},
28 m_calibrator{calibrator},
29 m_calibratePull{calibratePull} {}
30
31 const SegmentSeed* SeederStateBase::parent() const { return m_parent; }
32
33 double SeederStateBase::strawRadius(const SpacePoint& testMdt) const {
35 return static_cast<const xAOD::MdtDriftCircle*>(testMdt.primaryMeasurement())
36 ->readoutElement()->tubeRadius();
37 }
38 bool SeederStateBase::goodCandidate(const SpacePoint& testMdt) const {
39 switch (testMdt.type()) {
40 using enum xAOD::UncalibMeasType;
41 case MdtDriftCircleType:
42 return static_cast<const xAOD::MdtDriftCircle*>(testMdt.primaryMeasurement())->status() ==
43 Muon::MdtDriftCircleStatus::MdtStatusDriftTime;
44 case RpcStripType:
45 case TgcStripType:
46 return true;
47 default:
48 return false;
49 }
50 return false;
51 }
52 double SeederStateBase::candidateChi2(const Acts::CalibrationContext& cctx,
53 const Amg::Vector3D& seedPos,
54 const Amg::Vector3D& seedDir,
55 const double t0,
56 const SpacePoint& candidate) const {
57 if (m_calibratePull) {
58 const EventContext& ctx{*cctx.get<const EventContext*>()};
59 auto calibSp = m_calibrator->calibrate(ctx, &candidate, seedPos, seedDir, t0);
60 assert(calibSp != nullptr);
61 return SeedingAux::chi2Term(seedPos, seedDir, *calibSp);
62 }
63 return SeedingAux::chi2Term(seedPos, seedDir, candidate);
64 }
66 SeederStateBase::newContainer(const Acts::CalibrationContext& /*cctx*/) const {
67 return CalibCont_t{};
68 }
69 void SeederStateBase::append(const Acts::CalibrationContext& cctx,
70 const Amg::Vector3D& pos,
71 const Amg::Vector3D& dir,
72 const double t0,
73 const SpacePoint& appendMe,
74 CalibCont_t& appendTo) const {
75 const EventContext& ctx{*cctx.get<const EventContext*>()};
76 appendTo.push_back(m_calibrator->calibrate(ctx, &appendMe, pos, dir, t0));
77 }
78 bool SeederStateBase::stopSeeding(const std::size_t lowerLayer,
79 const std::size_t upperLayer) const {
80 return lowerLayer >= firstLayerFrom2ndMl() || lowerLayer >= upperLayer;
81 }
82
83}
static Double_t t0
Interface class to refine the space point calibration with an external seed.
Representation of a segment seed (a fully processed hough maximum) produced by the hough transform.
Definition SegmentSeed.h:14
std::size_t firstLayerFrom2ndMl() const
Returns the layer index with hits from the second multilayer.
std::vector< const SpacePoint * > HitVec
SpacePointPerLayerSplitter(const SpacePointBucket &bucket)
Constructor taking a complete bucket.
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
const xAOD::UncalibratedMeasurement * primaryMeasurement() const
Eigen::Matrix< double, 3, 1 > Vector3D
SpacePointPerLayerSplitter::HitLayVec HitLayerVec
SpacePointPerLayerSplitter::HitVec HitVec
MdtDriftCircle_v1 MdtDriftCircle
UncalibMeasType
Define the type of the uncalibrated measurement.
SeederStateBase(const SegmentSeed *parentSeed, const ISpacePointCalibrator *calibrator, const bool calibratedPull)
Protected constructor to instantiate the.
const ISpacePointCalibrator * m_calibrator
const SegmentSeed * parent() const
Returns the parent seed from which the state is constructed.
double candidateChi2(const Acts::CalibrationContext &cctx, const Amg::Vector3D &seedPos, const Amg::Vector3D &seedDir, const double t0, const SpacePoint &candidate) const
Returns the pull of the candidate w.r.t.
double strawRadius(const SpacePoint &testMdt) const
Returns the outer tube radius of the space point.
bool goodCandidate(const SpacePoint &testMdt) const
Returns whether the hit is a good candidate for seeding.
void append(const Acts::CalibrationContext &cctx, const Amg::Vector3D &pos, const Amg::Vector3D &dir, const double t0, const SpacePoint &appendMe, CalibCont_t &appendTo) const
Appends the space point measurement to the candidate seed container Optionally, the hit may be calibr...
CalibCont_t newContainer(const Acts::CalibrationContext &cctx) const
Creates a new candidate seed container.
std::vector< std::unique_ptr< CalibratedSpacePoint > > CalibCont_t
Abrivation of the collection of calibrated space points.
bool stopSeeding(const std::size_t lowerLayer, const std::size_t upperLayer) const
Requests whether the seed line generation shall be stopped based on the pair of.