ATLAS Offline Software
Loading...
Searching...
No Matches
MuonR4::SegmentFittingAlg Class Reference

Algorithm to handle segment fits. More...

#include <SegmentFittingAlg.h>

Inheritance diagram for MuonR4::SegmentFittingAlg:
Collaboration diagram for MuonR4::SegmentFittingAlg:

Public Member Functions

virtual ~SegmentFittingAlg ()
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) const override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

using Parameters = SegmentFit::Parameters
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

std::vector< std::unique_ptr< Segment > > fitSegmentSeed (const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const SegmentSeed *seed) const
void resolveAmbiguities (const ActsTrk::GeometryContext &gctx, std::vector< std::unique_ptr< Segment > > &segmentCandidates) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< SegmentSeedContainerm_seedKey {this, "ReadKey", "MuonHoughStationSegmentSeeds"}
 ReadHandle of the seeds.
SG::WriteHandleKey< SegmentContainerm_outSegments {this, "OutSegmentContainer", "R4MuonSegments"}
SG::ReadHandleKey< ActsTrk::GeometryContextm_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"}
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 IdHelperSvc.
ToolHandle< ISpacePointCalibratorm_calibTool {this, "Calibrator", "" }
 Handle to the space point calibrator.
ToolHandle< MuonValR4::IPatternVisualizationToolm_visionTool {this, "VisualizationTool", ""}
 Pattern visualization tool.
Gaudi::Property< bool > m_doT0Fit {this, "fitSegmentT0", true}
Gaudi::Property< bool > m_recalibInFit {this, "recalibInFit" , false}
Gaudi::Property< bool > m_tryPatternPars {this, "tryPatternPars", false}
 Try first to fit the pattern parameters. Then proceed with the straw line tangents.
Gaudi::Property< bool > m_hessianResidual {this, "useHessianResidual", false}
 Use the expliciit Hessian in the residual calculation.
Gaudi::Property< bool > m_doBeamspotConstraint {this, "doBeamspotConstraint", false}
 Add beamline constraint.
Gaudi::Property< double > m_beamSpotR {this, "BeamSpotRadius", 30.* Gaudi::Units::cm}
Gaudi::Property< double > m_beamSpotL {this, "BeamSpotLength", 2. * Gaudi::Units::m}
Gaudi::Property< double > m_seedHitChi2 {this, "ResoSeedHitAssoc", 5. }
 Two mdt seeds are the same if their defining parameters match wihin.
Gaudi::Property< bool > m_recalibSeed {this, "SeedRecalibrate", false}
 Toggle seed recalibration.
Gaudi::Property< double > m_outlierRemovalCut {this, "OutlierRemoval", 5.}
 Cut on the segment chi2 / nDoF to launch the outlier removal.
Gaudi::Property< double > m_recoveryPull {this, "RecoveryPull", 5.}
Gaudi::Property< unsigned > m_precHitCut {this, "PrecHitCut" , 3}
 Minimum number of precision hits to accept the segment.
Gaudi::Property< bool > m_useFastFitter {this, "useFastFitter", true}
 Use the fast Mdt fitter where possible.
Gaudi::Property< bool > m_fastPreFitter {this, "useFastPreFitter", false}
 The fast fitter is treated as a pre fitter.
Gaudi::Property< unsigned > m_maxIter {this, "maxIterations", 50}
 Tune the number of iterations.
std::unique_ptr< SegmentFit::SegmentAmbiSolverm_ambiSolver {}
 Pointer to the ambiguity reosolution.
std::unique_ptr< SegmentFit::SegmentLineFitterm_fitter {}
 Pointer to the actual segment fitter.
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Algorithm to handle segment fits.

This is currently a placeholder to test ideas!

Definition at line 34 of file SegmentFittingAlg.h.

Member Typedef Documentation

◆ Parameters

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ~SegmentFittingAlg()

MuonR4::SegmentFittingAlg::~SegmentFittingAlg ( )
virtualdefault

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode MuonR4::SegmentFittingAlg::execute ( const EventContext & ctx) const
overridevirtual

Definition at line 60 of file SegmentFittingAlg.cxx.

60 {
61 const ActsTrk::GeometryContext* gctx{nullptr};
62 ATH_CHECK(SG::get(gctx, m_geoCtxKey, ctx));
63 const SegmentSeedContainer* segmentSeeds=nullptr;
64 ATH_CHECK(SG::get(segmentSeeds, m_seedKey, ctx));
65
66 SG::WriteHandle writeSegments{m_outSegments, ctx};
67 ATH_CHECK(writeSegments.record(std::make_unique<SegmentContainer>()));
68 std::vector<std::unique_ptr<Segment>> allSegments{};
69 for (const SegmentSeed* seed : *segmentSeeds) {
70 std::vector<std::unique_ptr<Segment>> segments = fitSegmentSeed(ctx, *gctx, seed);
71 if (m_visionTool.isEnabled() && segments.size() > 1) {
72 auto drawFinalReco = [this, &segments, &gctx, &ctx,&seed](const std::string& nameTag) {
73 PrimitiveVec segmentLines{};
74 double yLegend{0.85};
75 segmentLines.push_back(drawLabel(std::format("# segments: {:d}", segments.size()), 0.2, yLegend, 14));
76 yLegend-=0.04;
77 for (const std::unique_ptr<Segment>& seg : segments) {
78 const Parameters pars = localSegmentPars(*gctx, *seg);
79 const auto [pos, dir] = makeLine(pars);
80 segmentLines.emplace_back(drawLine(pars, -Gaudi::Units::m, Gaudi::Units::m, kRed));
81 std::stringstream signStream{};
82 signStream<<std::format("#chi^{{2}}/nDoF: {:.2f} ({:}), ", seg->chi2() / seg->nDoF(), seg->nDoF());
83 signStream<<std::format("y_{{0}}={:.2f}",pars[toUnderlying(ParamDefs::y0)])<<", ";
84 signStream<<std::format("#theta={:.2f}^{{#circ}}", pars[toUnderlying(ParamDefs::theta)]/ Gaudi::Units::deg )<<", ";
85 for (const Segment::MeasType& m : seg->measurements()) {
86 if (m->type() == xAOD::UncalibMeasType::MdtDriftCircleType && m->fitState() == CalibratedSpacePoint::State::Valid) {
87 signStream<<(SeedingAux::strawSign(pos, dir, *m) == -1 ? "L" : "R");
88 }
89 }
90 segmentLines.push_back(drawLabel(signStream.str(), 0.2, yLegend, 13));
91 yLegend-=0.03;
92 }
93
94 m_visionTool->visualizeBucket(ctx, *seed->parentBucket(), nameTag, std::move(segmentLines));
95 };
96 drawFinalReco("all segments");
97 const unsigned int nBeforeAmbi = segments.size();
98 segments = m_ambiSolver->resolveAmbiguity(*gctx, std::move(segments));
99 if (nBeforeAmbi != segments.size()) {
100 drawFinalReco("post ambiguity");
101 }
102 } else if (m_visionTool.isEnabled() && segments.empty() &&
103 std::ranges::count_if(seed->getHitsInMax(),[this](const SpacePoint* hit){
104 return m_visionTool->isLabeled(*hit);
105 })) {
106 m_visionTool->visualizeSeed(ctx, *seed, "Failed fit");
107 }
108 allSegments.insert(allSegments.end(), std::make_move_iterator(segments.begin()),
109 std::make_move_iterator(segments.end()));
110 }
111 resolveAmbiguities(*gctx, allSegments);
112 writeSegments->insert(writeSegments->end(),
113 std::make_move_iterator(allSegments.begin()),
114 std::make_move_iterator(allSegments.end()));
115 ATH_MSG_VERBOSE("Found in total "<<writeSegments->size()<<" segments. ");
116 return StatusCode::SUCCESS;
117 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
std::unique_ptr< SegmentFit::SegmentAmbiSolver > m_ambiSolver
Pointer to the ambiguity reosolution.
ToolHandle< MuonValR4::IPatternVisualizationTool > m_visionTool
Pattern visualization tool.
SG::WriteHandleKey< SegmentContainer > m_outSegments
std::vector< std::unique_ptr< Segment > > fitSegmentSeed(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const SegmentSeed *seed) const
SegmentFit::Parameters Parameters
SG::ReadHandleKey< SegmentSeedContainer > m_seedKey
ReadHandle of the seeds.
void resolveAmbiguities(const ActsTrk::GeometryContext &gctx, std::vector< std::unique_ptr< Segment > > &segmentCandidates) const
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
std::unique_ptr< CalibratedSpacePoint > MeasType
Calibrated space point type.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Parameters localSegmentPars(const xAOD::MuonSegment &seg)
Returns the localSegPars decoration from a xAODMuon::Segment.
std::pair< Amg::Vector3D, Amg::Vector3D > makeLine(const Parameters &pars)
Returns the parsed parameters into an Eigen line parametrization.
MuonValR4::IPatternVisualizationTool::PrimitiveVec PrimitiveVec
DataVector< SegmentSeed > SegmentSeedContainer
std::unique_ptr< TLine > drawLine(const MuonR4::SegmentFit::Parameters &pars, const double lowEnd, const double highEnd, const int color=kRed+1, const int lineStyle=kDashed, const int view=objViewEta)
Draws a line from the segment fit parameters.
std::unique_ptr< TLatex > drawLabel(const std::string &text, const double xPos, const double yPos, const unsigned int fontSize=18)
Create a TLatex label,.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ fitSegmentSeed()

std::vector< std::unique_ptr< Segment > > MuonR4::SegmentFittingAlg::fitSegmentSeed ( const EventContext & ctx,
const ActsTrk::GeometryContext & gctx,
const SegmentSeed * seed ) const
private

At very high inclanation angles, the muon may traverse 3 hits in the same layer (E.g. BEE)

Draw the pattern with all possible seeds

Definition at line 120 of file SegmentFittingAlg.cxx.

122 {
123
124 const Amg::Transform3D& locToGlob{patternSeed->msSector()->localToGlobalTrans(gctx)};
125 std::vector<std::unique_ptr<Segment>> segments{};
126
127 MdtSegmentSeedGenerator::Config genCfg{};
128 genCfg.hitPullCut = m_seedHitChi2;
129 genCfg.recalibSeedCircles = m_recalibSeed;
130 genCfg.calibrator = m_calibTool.get();
131 genCfg.startWithPattern = m_tryPatternPars;
132
134 genCfg.busyLayerLimit = 2 + 2*(patternSeed->parameters()[toUnderlying(ParamDefs::theta)] > 50 * Gaudi::Units::deg);
136 if (m_visionTool.isEnabled()) {
137 PrimitiveVec seedLines{};
138 MdtSegmentSeedGenerator drawMe{name(), patternSeed, genCfg};
139 while(auto s = drawMe.nextSeed(ctx)) {
140 seedLines.push_back(drawLine(s->parameters, -Gaudi::Units::m, Gaudi::Units::m, kViolet));
141 }
142 seedLines.push_back(drawLabel(std::format("possible seeds: {:d}", drawMe.numGenerated()), 0.2, 0.85, 14));
143 m_visionTool->visualizeSeed(ctx, *patternSeed, "pattern", std::move(seedLines));
144 }
145
146 MdtSegmentSeedGenerator seedGen{name(), patternSeed, std::move(genCfg)};
147 ATH_MSG_VERBOSE("fitSegmentHits() - Start segment seed search");
148 while (auto seed = seedGen.nextSeed(ctx)) {
149 auto segment = m_fitter->fitSegment(ctx, patternSeed, seed->parameters,
150 locToGlob, std::move(seed->measurements));
151 if (segment) {
152 segments.push_back(std::move(segment));
153 }
154 }
155 ATH_MSG_VERBOSE("fitSegmentHits() - In total "<<segments.size()<<" segment were constructed ");
156 return segments;
157 }
Gaudi::Property< bool > m_recalibSeed
Toggle seed recalibration.
Gaudi::Property< double > m_seedHitChi2
Two mdt seeds are the same if their defining parameters match wihin.
ToolHandle< ISpacePointCalibrator > m_calibTool
Handle to the space point calibrator.
std::unique_ptr< SegmentFit::SegmentLineFitter > m_fitter
Pointer to the actual segment fitter.
Gaudi::Property< bool > m_tryPatternPars
Try first to fit the pattern parameters. Then proceed with the straw line tangents.
Eigen::Affine3d Transform3D

◆ initialize()

StatusCode MuonR4::SegmentFittingAlg::initialize ( )
overridevirtual

Definition at line 27 of file SegmentFittingAlg.cxx.

27 {
28 ATH_CHECK(m_geoCtxKey.initialize());
29 ATH_CHECK(m_seedKey.initialize());
30 ATH_CHECK(m_outSegments.initialize());
31 ATH_CHECK(m_calibTool.retrieve());
32 ATH_CHECK(m_idHelperSvc.retrieve());
33 ATH_CHECK(m_visionTool.retrieve(EnableTool{!m_visionTool.empty()}));
34 SegmentAmbiSolver::Config cfg{};
35 m_ambiSolver = std::make_unique<SegmentAmbiSolver>(name(), std::move(cfg));
36
37 SegmentLineFitter::Config fitCfg{};
38 fitCfg.calibrator = m_calibTool.get();
39 fitCfg.visionTool = m_visionTool.get();
40 fitCfg.idHelperSvc = m_idHelperSvc.get();
41 fitCfg.fitT0 = m_doT0Fit;
42 fitCfg.recalibrate = m_recalibInFit;
43 fitCfg.useFastFitter = m_useFastFitter;
44 fitCfg.fastPreFitter = m_fastPreFitter;
45 fitCfg.useHessian = m_hessianResidual;
46
47 fitCfg.doBeamSpot = m_doBeamspotConstraint;
48 fitCfg.beamSpotRadius = m_beamSpotR;
49 fitCfg.beamSpotLength = m_beamSpotL;
50
51 fitCfg.outlierRemovalCut = m_outlierRemovalCut;
52 fitCfg.recoveryPull = m_recoveryPull;
53 fitCfg.nPrecHitCut = m_precHitCut;
54 fitCfg.maxIter = m_maxIter;
55
56 m_fitter = std::make_unique<SegmentFit::SegmentLineFitter>(name(), std::move(fitCfg));
57
58 return StatusCode::SUCCESS;
59 }
Gaudi::Property< unsigned > m_precHitCut
Minimum number of precision hits to accept the segment.
Gaudi::Property< bool > m_hessianResidual
Use the expliciit Hessian in the residual calculation.
Gaudi::Property< bool > m_useFastFitter
Use the fast Mdt fitter where possible.
Gaudi::Property< double > m_beamSpotL
Gaudi::Property< bool > m_recalibInFit
Gaudi::Property< bool > m_fastPreFitter
The fast fitter is treated as a pre fitter.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc.
Gaudi::Property< bool > m_doBeamspotConstraint
Add beamline constraint.
Gaudi::Property< bool > m_doT0Fit
Gaudi::Property< double > m_recoveryPull
Gaudi::Property< double > m_beamSpotR
Gaudi::Property< unsigned > m_maxIter
Tune the number of iterations.
Gaudi::Property< double > m_outlierRemovalCut
Cut on the segment chi2 / nDoF to launch the outlier removal.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ resolveAmbiguities()

void MuonR4::SegmentFittingAlg::resolveAmbiguities ( const ActsTrk::GeometryContext & gctx,
std::vector< std::unique_ptr< Segment > > & segmentCandidates ) const
private

Definition at line 159 of file SegmentFittingAlg.cxx.

160 {
161 if (segmentCandidates.empty()) {
162 return;
163 }
164 using SegmentVec = std::vector<std::unique_ptr<Segment>>;
165 ATH_MSG_VERBOSE("Resolve ambiguities amongst "<<segmentCandidates.size()<<" segment candidates. ");
166 std::unordered_map<const MuonGMR4::SpectrometerSector*, SegmentVec> candidatesPerChamber{};
167
168 for (std::unique_ptr<Segment>& sortMe : segmentCandidates) {
169 const MuonGMR4::SpectrometerSector* chamb = sortMe->msSector();
170 candidatesPerChamber[chamb].push_back(std::move(sortMe));
171 }
172 segmentCandidates.clear();
173 for (auto& [chamber, resolveMe] : candidatesPerChamber) {
174 SegmentVec resolvedSegments = m_ambiSolver->resolveAmbiguity(gctx, std::move(resolveMe));
175 segmentCandidates.insert(segmentCandidates.end(),
176 std::make_move_iterator(resolvedSegments.begin()),
177 std::make_move_iterator(resolvedSegments.end()));
178 }
179 }
SegmentAmbiSolver::SegmentVec SegmentVec

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_ambiSolver

std::unique_ptr<SegmentFit::SegmentAmbiSolver> MuonR4::SegmentFittingAlg::m_ambiSolver {}
private

Pointer to the ambiguity reosolution.

Definition at line 92 of file SegmentFittingAlg.h.

92{};

◆ m_beamSpotL

Gaudi::Property<double> MuonR4::SegmentFittingAlg::m_beamSpotL {this, "BeamSpotLength", 2. * Gaudi::Units::m}
private

Definition at line 72 of file SegmentFittingAlg.h.

72{this, "BeamSpotLength", 2. * Gaudi::Units::m};

◆ m_beamSpotR

Gaudi::Property<double> MuonR4::SegmentFittingAlg::m_beamSpotR {this, "BeamSpotRadius", 30.* Gaudi::Units::cm}
private

Definition at line 71 of file SegmentFittingAlg.h.

71{this, "BeamSpotRadius", 30.* Gaudi::Units::cm};

◆ m_calibTool

ToolHandle<ISpacePointCalibrator> MuonR4::SegmentFittingAlg::m_calibTool {this, "Calibrator", "" }
private

Handle to the space point calibrator.

Definition at line 59 of file SegmentFittingAlg.h.

59{this, "Calibrator", "" };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doBeamspotConstraint

Gaudi::Property<bool> MuonR4::SegmentFittingAlg::m_doBeamspotConstraint {this, "doBeamspotConstraint", false}
private

Add beamline constraint.

Definition at line 70 of file SegmentFittingAlg.h.

70{this, "doBeamspotConstraint", false};

◆ m_doT0Fit

Gaudi::Property<bool> MuonR4::SegmentFittingAlg::m_doT0Fit {this, "fitSegmentT0", true}
private

Definition at line 63 of file SegmentFittingAlg.h.

63{this, "fitSegmentT0", true};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_fastPreFitter

Gaudi::Property<bool> MuonR4::SegmentFittingAlg::m_fastPreFitter {this, "useFastPreFitter", false}
private

The fast fitter is treated as a pre fitter.

Definition at line 88 of file SegmentFittingAlg.h.

88{this, "useFastPreFitter", false};

◆ m_fitter

std::unique_ptr<SegmentFit::SegmentLineFitter> MuonR4::SegmentFittingAlg::m_fitter {}
private

Pointer to the actual segment fitter.

Definition at line 94 of file SegmentFittingAlg.h.

94{};

◆ m_geoCtxKey

SG::ReadHandleKey<ActsTrk::GeometryContext> MuonR4::SegmentFittingAlg::m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"}
private

Definition at line 55 of file SegmentFittingAlg.h.

55{this, "AlignmentKey", "ActsAlignment", "cond handle key"};

◆ m_hessianResidual

Gaudi::Property<bool> MuonR4::SegmentFittingAlg::m_hessianResidual {this, "useHessianResidual", false}
private

Use the expliciit Hessian in the residual calculation.

Definition at line 68 of file SegmentFittingAlg.h.

68{this, "useHessianResidual", false};

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonR4::SegmentFittingAlg::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

IdHelperSvc.

Definition at line 57 of file SegmentFittingAlg.h.

57{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_maxIter

Gaudi::Property<unsigned> MuonR4::SegmentFittingAlg::m_maxIter {this, "maxIterations", 50}
private

Tune the number of iterations.

Definition at line 90 of file SegmentFittingAlg.h.

90{this, "maxIterations", 50};

◆ m_outlierRemovalCut

Gaudi::Property<double> MuonR4::SegmentFittingAlg::m_outlierRemovalCut {this, "OutlierRemoval", 5.}
private

Cut on the segment chi2 / nDoF to launch the outlier removal.

Definition at line 81 of file SegmentFittingAlg.h.

81{this, "OutlierRemoval", 5.};

◆ m_outSegments

SG::WriteHandleKey<SegmentContainer> MuonR4::SegmentFittingAlg::m_outSegments {this, "OutSegmentContainer", "R4MuonSegments"}
private

Definition at line 53 of file SegmentFittingAlg.h.

53{this, "OutSegmentContainer", "R4MuonSegments"};

◆ m_precHitCut

Gaudi::Property<unsigned> MuonR4::SegmentFittingAlg::m_precHitCut {this, "PrecHitCut" , 3}
private

Minimum number of precision hits to accept the segment.

Definition at line 84 of file SegmentFittingAlg.h.

84{this, "PrecHitCut" , 3};

◆ m_recalibInFit

Gaudi::Property<bool> MuonR4::SegmentFittingAlg::m_recalibInFit {this, "recalibInFit" , false}
private

Definition at line 64 of file SegmentFittingAlg.h.

64{this, "recalibInFit" , false};

◆ m_recalibSeed

Gaudi::Property<bool> MuonR4::SegmentFittingAlg::m_recalibSeed {this, "SeedRecalibrate", false}
private

Toggle seed recalibration.

The two seed circles are recalibrated using the initial seed

Definition at line 79 of file SegmentFittingAlg.h.

79{this, "SeedRecalibrate", false};

◆ m_recoveryPull

Gaudi::Property<double> MuonR4::SegmentFittingAlg::m_recoveryPull {this, "RecoveryPull", 5.}
private

Definition at line 82 of file SegmentFittingAlg.h.

82{this, "RecoveryPull", 5.};

◆ m_seedHitChi2

Gaudi::Property<double> MuonR4::SegmentFittingAlg::m_seedHitChi2 {this, "ResoSeedHitAssoc", 5. }
private

Two mdt seeds are the same if their defining parameters match wihin.

Definition at line 76 of file SegmentFittingAlg.h.

76{this, "ResoSeedHitAssoc", 5. };

◆ m_seedKey

SG::ReadHandleKey<SegmentSeedContainer> MuonR4::SegmentFittingAlg::m_seedKey {this, "ReadKey", "MuonHoughStationSegmentSeeds"}
private

ReadHandle of the seeds.

Definition at line 51 of file SegmentFittingAlg.h.

51{this, "ReadKey", "MuonHoughStationSegmentSeeds"};

◆ m_tryPatternPars

Gaudi::Property<bool> MuonR4::SegmentFittingAlg::m_tryPatternPars {this, "tryPatternPars", false}
private

Try first to fit the pattern parameters. Then proceed with the straw line tangents.

Definition at line 66 of file SegmentFittingAlg.h.

66{this, "tryPatternPars", false};

◆ m_useFastFitter

Gaudi::Property<bool> MuonR4::SegmentFittingAlg::m_useFastFitter {this, "useFastFitter", true}
private

Use the fast Mdt fitter where possible.

Definition at line 86 of file SegmentFittingAlg.h.

86{this, "useFastFitter", true};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_visionTool

ToolHandle<MuonValR4::IPatternVisualizationTool> MuonR4::SegmentFittingAlg::m_visionTool {this, "VisualizationTool", ""}
private

Pattern visualization tool.

Definition at line 61 of file SegmentFittingAlg.h.

61{this, "VisualizationTool", ""};

The documentation for this class was generated from the following files: