9 return angle / Gaudi::Units::deg;
11 std::string printMuon(
const xAOD::Muon& muon) {
14 std::ostringstream oss;
15 oss<<
"FastMuonSA, Eta: "<<
muon.eta() <<
", Phi: "<<
inDeg(
muon.phi())<<
", Pt: "<<
muon.pt() / Gaudi::Units::GeV<<
" GeV, Charge: "<<
muon.charge() << std::endl
16 <<
"Associated GlobalPattern: "<< **
acc(muon);
20 const std::string patternLinkStr{
"globalPatternLink"};
66 m_globPatFinder = std::make_unique<GlobalPatternFinder>(name(), std::move(patCfg));
86 m_saBuilder = std::make_unique<FastMuonSABuilder>(name(), std::move(saCfg));
119 return StatusCode::SUCCESS;
126 auto& spc = inSpacePoints.emplace_back(
nullptr);
128 ATH_MSG_DEBUG(
"Reading " << spc->size() <<
" SP buckets from collection: " << key);
135 BucketPerContainer outBuckets{};
137 outBuckets.emplace(inSpc, BucketPerContainer::mapped_type{});
142 for (
size_t idx = 0; idx < inSpacePoints.size(); ++idx) {
144 const auto& outBucketVec = outBuckets.at(inSpc);
147 ATH_CHECK(writeHandle.
record(std::make_unique<SpacePointContainer>()));
150 writeHandle->push_back(std::make_unique<SpacePointBucket>(*bucket));
154 <<
" SP Buckets into StoreGate with key "
159 ATH_CHECK(patWriteHandle.
record(std::make_unique<GlobalPatternContainer>()));
161 patWriteHandle->push_back(std::make_unique<GlobalPattern>(std::move(pat)));
163 ATH_MSG_DEBUG(
"Written "<<patWriteHandle->size()<<
" GlobalPatterns into StoreGate.");
168 std::size_t patIdx{0};
175 ATH_MSG_DEBUG(
"No muon candidate could be built for pattern " << *pat);
180 acc(*newMuon) = Patternlink{*patWriteHandle, patIdx};
181 ATH_MSG_DEBUG(
"Add new muon candidate: " << printMuon(*newMuon));
184 ATH_MSG_DEBUG(
"Written "<<fillMuons->size()<<
" FastMuonSA into StoreGate.");
185 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
constexpr float inDeg(const float rad)
ElementLink implementation for ROOT usage.
xAOD::FillContainer< xAOD::MuonContainer, xAOD::MuonAuxContainerR4 > MuonCont_t
Define the muon container type.
std::unordered_map< const SpacePointContainer *, std::vector< const SpacePointBucket * > > BucketPerContainer
Abrivation for a collection of space-point buckets grouped by their corresponding input container.
Muon::MuonStationIndex::LayerIndex LayerIndex
Type alias for the station layer index.
DoubleProperty m_phiTolerance
Maximum phi difference [rad] allowed between two hits belonging to the same pattern.
virtual StatusCode execute(const EventContext &ctx) const override
SG::WriteHandleKeyArray< SpacePointContainer > m_outSpacePoints
Write handle key for the output buckets.
DoubleProperty m_recoveryPull
Pull value for hit recovery.
ToolHandle< MuonValR4::IFastRecoVisualizationTool > m_patVisionTool
Handle to the visualization tool for global patterns.
DoubleProperty m_outlierRemovalCut
Cut on the segment chi2 / nDoF to launch the outlier removal.
std::unique_ptr< FastReco::FastMuonSABuilder > m_saBuilder
Pointer to the FastMuonSABuilder.
BooleanProperty m_fastPreFitter
The fast fitter is treated as a pre fitter.
BooleanProperty m_recalibInFit
-----------------------— Configuration options for segment fitter ----------------------—
ActsTrk::GeoContextReadKey_t m_geoCtxKey
Geometry context key.
UnsignedIntegerProperty m_maxMissLayersInStation
Maximum number of missed candidate hits in different measurement layers during pattern building allow...
BooleanProperty m_seedFromMdt
Toggle the seeding from MDT hits.
ToolHandle< MuonValR4::IPatternVisualizationTool > m_segVisionTool
Handle to the visualization tool for segments.
UnsignedIntegerProperty m_minTriggerLayers
Requirement on trigger layers in the bending direction to accept a pattern.
SG::ReadHandleKeyArray< SpacePointContainer > m_inSpacePoints
Keys of SpacePoint containers to read.
DoubleProperty m_meanNormRes2Cut
Quality cut on pattern'mean squared normalized residual.
UnsignedIntegerProperty m_precHitCut
Minimum number of precision hits to accept the segment.
BooleanProperty m_useMdtHits
--------------— Configuration options for the global pattern finder --------------—
std::unique_ptr< FastReco::GlobalPatternFinder > m_globPatFinder
Pointer to the actual global pattern finder.
UnsignedIntegerProperty m_minStationLayers
Minimum number of layers in a station to be considered a good station.
StringProperty m_outSpacePointSuffix
Suffix to add to the input space point container names to create the output container names,...
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Handle to the MuonIdHelper service.
DoubleProperty m_goodSegmentCut
Reduced chi2 defining a good segment, stopping the fit of other segments in the same station.
BooleanProperty m_recalibSeed
Toggle seed recalibration.
ToolHandle< ISpacePointCalibrator > m_calibTool
Handle to the space point calibrator tool.
BooleanProperty m_seedFromInner
Activate the seeding from Inner station.
UnsignedIntegerProperty m_maxSeedAttempts
Maximum number of attempts to build a pattern from hits already used in existing patterns.
DoubleProperty m_minHitDistance4Line
Minimum distance [mm] between two hits for being used to compute a reliable pattern line.
DoubleProperty m_seedHitChi2
Two mdt seeds are the same if their defining parameters match wihin.
SG::WriteHandleKey< GlobalPatternContainer > m_outPatterns
Write handle key for the output global patterns.
DoubleProperty m_baseResidualSigma
Effective isotropic position uncertainty [mm], including detector resolution and unmodelled effects.
UnsignedIntegerProperty m_minPhiLayers
Minimum number of phi layers required to accept a pattern.
ToolHandle< ITrackSeedingTool > m_seedingTool
The track seeding tool to construct the seed candidates and to estimate the initial parameters.
UnsignedIntegerProperty m_minPrecisionLayers
Requirement on precision layers in the bending direction to accept a pattern.
FastReco::GlobalPatternFinder::SpacePointContainerVec SpacePointContainerVec
Abrivation for a vector of space-point containers.
SG::WriteHandleKey< xAOD::MuonContainer > m_outMuons
Write handle key for the output Fast Reco SA muons.
BooleanProperty m_ignoreFailedPreFit
Switch to try the full fit when the fast pre-fitter fails.
BooleanProperty m_hessianResidual
Use the expliciit Hessian in the residual calculation.
UnsignedIntegerProperty m_maxIter
Tune the number of iterations.
virtual StatusCode initialize() override
BooleanProperty m_useFastFitter
Use the fast Mdt fitter where possible.
FastReco::GlobalPatternFinder::PatternVec PatternVec
Abrivation for a vector of global patterns.
DoubleProperty m_thetaSearchWindow
Size of theta window [rad] to search for compatible hits with a seed, tailored to the target pt cutof...
Data class to represent an eta maximum in hough space.
: The muon space point bucket represents a collection of points that will bre processed together in t...
Helper class to provide type-safe access to aux data.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
StatusCode record(const SG::WriteHandleKey< Cont_t > &key, const EventContext &ctx)
Record the container to store gate using the passed write handle key.
std::vector< std::string > patterns
This header ties the generic definitions in this package.
DataVector< SpacePointBucket > SpacePointContainer
Abrivation of the space point container type.
LayerIndex
enum to classify the different layers in the muon spectrometer
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Muon_v1 Muon
Reference the current persistent version:
bool ignoreFailedPreFit
Whether to ignore failed pre-fits and try the full fit anyway.
double outlierRemovalCut
Cut on the segment chi2 / nDoF to launch the outlier removal.
bool recalibInFit
Whether to recalibrate hits during fitting.
double goodSegmentCut
Reduced chi2 defining a good segment, stopping the fit of other segments in the same station.
bool useHessianResidual
Whether to use Hessian residuals.
const MuonValR4::IPatternVisualizationTool * visionTool
Pointer to the visualization tool.
const Muon::IMuonIdHelperSvc * idHelperSvc
Pointer to the idHelperSvc.
const ISpacePointCalibrator * calibrator
Pointer to the calibrator.
bool fastPreFitter
Whether the fast fitter is used as a pre-fitter.
const ITrackSeedingTool * trackSeeder
Pointer to the track seeder for momentum estimate.
bool useFastFitter
Whether to use the fast fitter.
double seedHitChi2
Two mdt seeds are the same if their defining parameters match within.
double recoveryPull
Pull value for hit recovery.
unsigned precHitCut
Minimum number of precision hits required for a segment.
unsigned maxIter
Maximum number of iterations in the fit.
bool recalibSeed
Toggle seed recalibration.
bool useMdtHits
Toggle the utilization of MDT hits to build patterns.
double thetaSearchWindow
Size of theta window in radians to search for comapatible hits with a pattern, tailored to the target...
bool seedFromMdt
Toggle the seeding from MDT hits.
unsigned int minPhiLayers
Minimum number of phi layers required to accept a pattern.
const Muon::IMuonIdHelperSvc * idHelperSvc
Pointer to the idHelperSvc.
std::vector< LayerIndex > layerSeedings
Vector configuring the seeding layers.
double phiTolerance
Maximum phi difference in radians allowed between two hits.
unsigned int minTriggerLayers
Minimum number of trigger layers in the bending direction required to accept a pattern.
const MuonValR4::IFastRecoVisualizationTool * visionTool
Pointer to the visualization tool.
unsigned int minStationLayers
Minimum number of layers in a station to be considered a good station.
unsigned int maxSeedAttempts
Maximum number of attempts to build a pattern from hits already used in existing patterns.
double minHitDistance4Line
Minimum distance (in mm) between two hits for being used to compute a reliable pattern line.
unsigned int minPrecisionLayers
Minimum number of precision layers in the bending direction required to accept a pattern.
double meanNormRes2Cut
Quality cut on pattern'mean squared normalized residual.
unsigned int maxMissLayersInStation
Maximum number of missed candidate hits in different measurement layers in a station.
double baseResidualSigma
Effective isotropic position uncertainty [mm], including detector resolution and unmodelled effects.