ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
MuonR4::SegmentFittingAlg Class Reference

Algorithm to handle segment fits
More...

#include <SegmentFittingAlg.h>

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

Public Types

using HitVec = SegmentFitResult::HitVec
 

Public Member Functions

virtual ~SegmentFittingAlg ()
 
virtual StatusCode initialize () override
 
virtual StatusCode execute (const EventContext &ctx) const override
 
 AthReentrantAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor with parameters: More...
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
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. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Private Types

using Parameters = SegmentFit::Parameters
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

template<class ContainerType >
StatusCode retrieveContainer (const EventContext &ctx, const SG::ReadHandleKey< ContainerType > &key, const ContainerType *&contToPush) const
 Helper method to fetch data from StoreGate. More...
 
SegmentFitResult fitSegmentHits (const EventContext &ctx, const ActsGeometryContext &gctx, const Parameters &startPars, SegmentFitResult::HitVec &&calibHits) const
 Executes the segment fit with start parameters. More...
 
std::vector< std::unique_ptr< Segment > > fitSegmentSeed (const EventContext &ctx, const ActsGeometryContext &gctx, const SegmentSeed *seed) const
 
bool removeOutliers (const EventContext &ctx, const ActsGeometryContext &gctx, const SegmentSeed &seed, SegmentFitResult &fitResult) const
 Spot hits with large discrepancy from the estimated parameters and remove them from the list. More...
 
bool plugHoles (const EventContext &ctx, const ActsGeometryContext &gctx, const SegmentSeed &seed, SegmentFitResult &toRecover) const
 Recovery of missed hits. More...
 
void eraseWrongHits (const ActsGeometryContext &gctx, SegmentFitResult &candidate) const
 Removes all hits from the segment which are obvious outliers. More...
 
void resolveAmbiguities (const ActsGeometryContext &gctx, std::vector< std::unique_ptr< Segment >> &segmentCandidates) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Static Private Member Functions

static std::unique_ptr< SegmentconvertToSegment (const Amg::Transform3D &locToGlobTrf, const SegmentSeed *parentSeed, SegmentFitResult &&toConvert)
 Converts the fit result into a segment object. More...
 

Private Attributes

SG::ReadHandleKey< SegmentSeedContainerm_seedKey {this, "ReadKey", "MuonHoughStationSegmentSeeds"}
 ReadHandle of the seeds. More...
 
SG::WriteHandleKey< SegmentContainerm_outSegments {this, "MuonSegmentContainer", "R4MuonSegments"}
 
SG::ReadHandleKey< ActsGeometryContextm_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"}
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 IdHelperSvc. More...
 
ToolHandle< ISpacePointCalibratorm_calibTool {this, "Calibrator", "" }
 Handle to the space point calibrator. More...
 
ToolHandle< MuonValR4::IPatternVisualizationToolm_visionTool {this, "VisualizationTool", ""}
 Pattern visualization tool. More...
 
Gaudi::Property< bool > m_useMinuit {this, "useMinuit", false}
 Toggle the fitter. More...
 
Gaudi::Property< bool > m_doT0Fit {this, "fitSegmentT0", true}
 
Gaudi::Property< bool > m_doBeamspotConstraint {this, "doBeamspotConstraint", false}
 Add beamline constraint. More...
 
Gaudi::Property< double > m_beamSpotR {this, "BeamSpotRadius", 30.* Gaudi::Units::cm}
 
Gaudi::Property< double > m_beamSpotL {this, "BeamSpotLength", 20. * Gaudi::Units::m}
 
Gaudi::Property< double > m_seedHitChi2 {this, "ResoSeedHitAssoc", 5. }
 Two mdt seeds are the same if their defining parameters match wihin. More...
 
Gaudi::Property< bool > m_recalibSeed {this, "SeedRecalibrate", false}
 Toggle seed recalibration. More...
 
Gaudi::Property< bool > m_refineSeed {this, "SeedRefine", false}
 Toggle seed refit. More...
 
Gaudi::Property< double > m_outlierRemovalCut {this, "OutlierRemoval", 5.}
 Cut on the segment chi2 / nDoF to launch the outlier removal. More...
 
Gaudi::Property< double > m_recoveryPull {this, "RecoveryPull", 5.}
 
std::unique_ptr< SegmentAmbiSolverm_ambiSolver {}
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
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 31 of file SegmentFittingAlg.h.

Member Typedef Documentation

◆ HitVec

Definition at line 38 of file SegmentFittingAlg.h.

◆ Parameters

Definition at line 41 of file SegmentFittingAlg.h.

◆ 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

◆ AthReentrantAlgorithm()

AthReentrantAlgorithm::AthReentrantAlgorithm

Constructor with parameters:

Definition at line 90 of file AthReentrantAlgorithm.cxx.

22  :
24 {
25 
26  // Set up to run AthAlgorithmDHUpdate in sysInitialize before
27  // merging depedency lists. This extends the output dependency
28  // list with any symlinks implied by inheritance relations.
29  m_updateDataHandles =
30  std::make_unique<AthenaBaseComps::AthAlgorithmDHUpdate>
32  std::move (m_updateDataHandles));
33 }

◆ cardinality()

unsigned int AthReentrantAlgorithm::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.

Override this to return 0 for reentrant algorithms.

Definition at line 55 of file AthReentrantAlgorithm.cxx.

56 {
57  return 0;
58 }

◆ convertToSegment()

std::unique_ptr< Segment > MuonR4::SegmentFittingAlg::convertToSegment ( const Amg::Transform3D locToGlobTrf,
const SegmentSeed parentSeed,
SegmentFitResult &&  toConvert 
)
staticprivate

Converts the fit result into a segment object.

Parameters
locToGlobTrfLocal to global transform to translate the segment parameters into global parameters
parentSeedSegment seed from which the segment was built
toConvertFitted segment that needs conversion

Definition at line 325 of file SegmentFittingAlg.cxx.

327  {
328  const auto [locPos, locDir] = data.makeLine();
329  Amg::Vector3D globPos = locToGlob * locPos;
330  Amg::Vector3D globDir = locToGlob.linear()* locDir;
331 
332 
333  auto finalSeg = std::make_unique<Segment>(std::move(globPos), std::move(globDir),
334  patternSeed, std::move(data.calibMeasurements),
335  data.chi2, data.nDoF);
336  finalSeg->setCallsToConverge(data.nIter);
337  finalSeg->setChi2PerMeasurement(std::move(data.chi2PerMeasurement));
338  finalSeg->setParUncertainties(std::move(data.segmentParErrs));
339  if (data.timeFit) {
340  finalSeg->setSegmentT0(data.segmentPars[toInt(ParamDefs::time)]);
341 
342  }
343 
344 
345  return finalSeg;
346  }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ 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.

95 { return m_detStore; }

◆ eraseWrongHits()

void MuonR4::SegmentFittingAlg::eraseWrongHits ( const ActsGeometryContext gctx,
SegmentFitResult candidate 
) const
private

Removes all hits from the segment which are obvious outliers.

E.g. tubes which cannot be crossed by the segment.

Parameters
gctxGeometry context needed to calculate the nominal time of arrival, if the time fit is activated
candidateReference of the segment candidate to prune.

The segment has never crossed the tube

Definition at line 529 of file SegmentFittingAlg.cxx.

529  {
530  auto [segPos, segDir] = makeLine(candidate.segmentPars);
531  candidate.calibMeasurements.erase(std::remove_if(candidate.calibMeasurements.begin(), candidate.calibMeasurements.end(),
532  [&segPos, &segDir](const HitVec::value_type& hit){
533  if (hit->fitState() != CalibratedSpacePoint::State::Outlier) {
534  return false;
535  }
538  const double dist = Amg::lineDistance(segPos, segDir, hit->positionInChamber(), hit->directionInChamber());
539  const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(hit->spacePoint()->primaryMeasurement());
540  return dist >= dc->readoutElement()->innerTubeRadius();
541  }
542  return true;
543  }), candidate.calibMeasurements.end());
544  const MuonGMR4::SpectrometerSector* chamber{nullptr};
545  for (const auto& hit : candidate.calibMeasurements) {
546  if (hit->type() != xAOD::UncalibMeasType::Other){
547  chamber = hit->spacePoint()->msSector();
548  break;
549  }
550  }
551  std::optional<double> timeOfFlight = candidate.timeFit ? std::make_optional<double>((chamber->localToGlobalTrans(gctx)*segPos).mag() * inv_c)
552  : std::nullopt;
553  auto [updatedMeasChi2, updateChi2] = SegmentFitHelpers::postFitChi2PerMas(candidate.segmentPars, timeOfFlight,
554  candidate.calibMeasurements, msgStream());
555  ATH_MSG_VERBOSE("The measurements before "<<candidate.chi2PerMeasurement<<", after: "<<updatedMeasChi2<<", chi2: "<<updateChi2);
556  candidate.chi2PerMeasurement = std::move(updatedMeasChi2);
557  }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

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

Definition at line 74 of file SegmentFittingAlg.cxx.

74  {
75 
76  const ActsGeometryContext* gctx{nullptr};
78  const SegmentSeedContainer* segmentSeeds=nullptr;
79  ATH_CHECK(retrieveContainer(ctx, m_seedKey, segmentSeeds));
80 
81  SG::WriteHandle writeSegments{m_outSegments, ctx};
82  ATH_CHECK(writeSegments.record(std::make_unique<SegmentContainer>()));
83  std::vector<std::unique_ptr<Segment>> allSegments{};
84  for (const SegmentSeed* seed : *segmentSeeds) {
85  std::vector<std::unique_ptr<Segment>> segments = fitSegmentSeed(ctx, *gctx, seed);
86  if (m_visionTool.isEnabled() && segments.size() > 1) {
87  auto drawFinalReco = [this, &segments, &gctx, &ctx,&seed](const std::string& nameTag) {
88  PrimitiveVec segmentLines{};
89  double yLegend{0.85};
90  segmentLines.push_back(drawLabel(std::format("# segments: {:d}", segments.size()), 0.12, yLegend, 14));
91  yLegend-=0.04;
92  for (const std::unique_ptr<Segment>& seg : segments) {
93  const Parameters pars = localSegmentPars(*gctx, *seg);
94  const auto [locPos, locDir] = makeLine(pars);
95 
96  segmentLines.emplace_back(drawLine(pars, -Gaudi::Units::m, Gaudi::Units::m, kRed));
97  std::stringstream signStream{};
98  signStream<<"#chi^{2}/nDoF: "<<std::format("{:.2f}", seg->chi2() / seg->nDoF())<<"("<<seg->nDoF()<<"), ";
99  signStream<<"y_{0}="<<std::format("{:.2f}",pars[toInt(ParamDefs::y0)])<<", ";
100  signStream<<std::format("#theta={:.2f}", pars[toInt(ParamDefs::theta)]/ Gaudi::Units::deg )<<", ";
101  for (const Segment::MeasType& m : seg->measurements()) {
103  signStream<<(SegmentFitHelpers::driftSign(locPos, locDir, *m, msgStream()) == -1 ? "L" : "R");
104  }
105  }
106  segmentLines.push_back(drawLabel(signStream.str(), 0.12, yLegend, 12));
107  yLegend-=0.03;
108  }
109 
110  m_visionTool->visualizeBucket(ctx, *seed->parentBucket(), nameTag, std::move(segmentLines));
111  };
112  drawFinalReco("all segments");
113  const unsigned int nBeforeAmbi = segments.size();
114  segments = m_ambiSolver->resolveAmbiguity(*gctx, std::move(segments));
115  if (nBeforeAmbi != segments.size()) {
116  drawFinalReco("post ambiguity");
117  }
118  }
119  allSegments.insert(allSegments.end(), std::make_move_iterator(segments.begin()),
120  std::make_move_iterator(segments.end()));
121  }
122  resolveAmbiguities(*gctx, allSegments);
123  writeSegments->insert(writeSegments->end(),
124  std::make_move_iterator(allSegments.begin()),
125  std::make_move_iterator(allSegments.end()));
126  ATH_MSG_VERBOSE("Found in total "<<writeSegments->size()<<" segments. ");
127  return StatusCode::SUCCESS;
128  }

◆ 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 & AthReentrantAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 79 of file AthReentrantAlgorithm.cxx.

80 {
81  // If we didn't find any symlinks to add, just return the collection
82  // from the base class. Otherwise, return the extended collection.
83  if (!m_extendedExtraObjects.empty()) {
85  }
86  return Algorithm::extraOutputDeps();
87 }

◆ filterPassed()

virtual bool AthReentrantAlgorithm::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 135 of file AthReentrantAlgorithm.h.

135  {
136  return execState( ctx ).filterPassed();
137  }

◆ fitSegmentHits()

SegmentFitResult MuonR4::SegmentFittingAlg::fitSegmentHits ( const EventContext &  ctx,
const ActsGeometryContext gctx,
const Parameters startPars,
SegmentFitResult::HitVec &&  calibHits 
) const
private

Executes the segment fit with start parameters.

The returned fit result indicates whether the fit was a success and all relevant output parameters

ctx: Event context needed to access the calibration constants of the hits

gctx: Geometry context needed to place the segment globally within ATLAS to calculate the nominal time of arrival

startPars: Segment parameters preestimated from the SegmentSeed (either hough pattern or two drift circle seed)

calibHits: Vector of strip & mdt hits to consider for the fit

Add beamspot if neccessary

placeholder for a very generous beam spot: 300mm in X,Y (tracking volume), 20000 along Z

Configure the minimizer

Assumption that the particle travels at the speed of light

Execute fit

Definition at line 145 of file SegmentFittingAlg.cxx.

148  {
149  SegmentFitResult data{};
150  if (calibHits.empty()) {
151  ATH_MSG_WARNING("No hits, no segment");
152  return data;
153  }
154 
157  unsigned int numPhi = std::accumulate(calibHits.begin(), calibHits.end(),0,
158  [](unsigned int n, const HitVec::value_type& hit){
159  return n + (hit->fitState() == CalibratedSpacePoint::State::Valid &&
160  hit->measuresPhi());
161  });
162  if (numPhi) {
163  const Amg::Transform3D globToLoc{calibHits[0]->spacePoint()->msSector()->globalToLocalTrans(gctx)};
164  Amg::Vector3D beamSpot{globToLoc.translation()};
165  AmgSymMatrix(3) covariance{AmgSymMatrix(3)::Identity()};
167  covariance(0,0) = std::pow(m_beamSpotR, 2);
168  covariance(1,1) = std::pow(m_beamSpotR, 2);
169  covariance(2,2) = std::pow(m_beamSpotL, 2);
170  AmgSymMatrix(3) jacobian = globToLoc.linear();
171  covariance = jacobian * covariance * jacobian.transpose();
172  AmgSymMatrix(2) beamSpotCov{covariance.block<2,2>(0,0)};
173  auto beamSpotSP = std::make_unique<CalibratedSpacePoint>(nullptr, std::move(beamSpot), Amg::Vector3D::Zero());
174  beamSpotSP->setCovariance<2>(std::move(beamSpotCov));
175  ATH_MSG_VERBOSE("Beam spot constraint "<<Amg::toString(beamSpotSP->positionInChamber())<<", "<<toString(beamSpotSP->covariance()));
176  calibHits.push_back(std::move(beamSpotSP));
177  }
178  }
179 
180  const Amg::Transform3D& locToGlob{calibHits[0]->spacePoint()->msSector()->localToGlobalTrans(gctx)};
181 
182  if (!m_useMinuit) {
183  MdtSegmentFitter::Config fitCfg{};
184  fitCfg.calibrator = m_calibTool.get();
185  fitCfg.doTimeFit = m_doT0Fit;
186 
187  MdtSegmentFitter fitter{name(), std::move(fitCfg)};
188  return fitter.fitSegment(ctx, std::move(calibHits), startPars, locToGlob);
189  }
190 
191  data.segmentPars = startPars;
192 
193  CalibSegmentChi2Minimizer c2f{name(), ctx, locToGlob, copy(calibHits), m_calibTool.get(), m_doT0Fit};
194  data.hasPhi = c2f.hasPhiMeas();
195  data.timeFit = c2f.doTimeFit();
196  data.nDoF = c2f.nDoF();
197  if (data.nDoF <= 0) {
198  ATH_MSG_DEBUG("Reject fit due to 0 degrees of freedom");
199  return data;
200  }
201  ROOT::Minuit2::Minuit2Minimizer minimizer((name() + std::to_string(ctx.eventID().event_number())).c_str());
203  minimizer.SetMaxFunctionCalls(100000);
204  minimizer.SetTolerance(0.0001);
205  minimizer.SetPrintLevel(-1);
206  minimizer.SetStrategy(1);
207 
208  minimizer.SetVariable(toInt(ParamDefs::y0), "y0", startPars[toInt(ParamDefs::y0)], 1.e-5);
209  minimizer.SetVariable(toInt(ParamDefs::theta), "theta", startPars[toInt(ParamDefs::theta)], 1.e-5);
210  minimizer.SetVariableLimits(toInt(ParamDefs::y0),
211  startPars[toInt(ParamDefs::y0)] - 60. *Gaudi::Units::cm,
212  startPars[toInt(ParamDefs::y0)] + 60. *Gaudi::Units::cm);
213  minimizer.SetVariableLimits(toInt(ParamDefs::theta),
214  startPars[toInt(ParamDefs::theta)] - 0.6,
215  startPars[toInt(ParamDefs::theta)] + 0.6);
216 
217  if (data.hasPhi) {
218  minimizer.SetVariable(toInt(ParamDefs::x0), "x0", startPars[toInt(ParamDefs::x0)], 1.e-5);
219  minimizer.SetVariable(toInt(ParamDefs::phi), "phi", startPars[toInt(ParamDefs::phi)], 1.e-5);
220  minimizer.SetVariableLimits(toInt(ParamDefs::x0),
221  startPars[toInt(ParamDefs::x0)] - 600,
222  startPars[toInt(ParamDefs::x0)] + 600);
223  minimizer.SetVariableLimits(toInt(ParamDefs::phi),
224  startPars[toInt(ParamDefs::phi)] - 0.6,
225  startPars[toInt(ParamDefs::phi)] + 0.6);
226  } else {
227  minimizer.SetFixedVariable(toInt(ParamDefs::x0), "x0", 0.);
228  minimizer.SetFixedVariable(toInt(ParamDefs::phi), "phi", 90.*Gaudi::Units::deg);
229  }
231  if (data.timeFit) {
232  minimizer.SetVariable(toInt(ParamDefs::time), "t0", startPars[toInt(ParamDefs::time)] , 1.);
233  minimizer.SetVariableLimits(toInt(ParamDefs::time),
234  startPars[toInt(ParamDefs::time)] - 50,
235  startPars[toInt(ParamDefs::time)] + 50);
236  } else{
237  minimizer.SetFixedVariable(toInt(ParamDefs::time), "t0", 0.);
238  }
239  minimizer.SetFunction(c2f);
241  if (!minimizer.Minimize() || !minimizer.Hesse()) {
242  data.calibMeasurements = std::move(calibHits);
243  } else {
244  const double* xs = minimizer.X();
245  const double* errs = minimizer.Errors();
246 
247  for (unsigned int p = 0; p < toInt(ParamDefs::nPars); ++p) {
248  data.segmentPars[p] = xs[p];
249  data.segmentParErrs(p,p) = errs[p];
250  }
251  std::optional<double> timeOfArrival{std::nullopt};
252  const auto [locPos, locDir] = data.makeLine();
253  if (data.timeFit) {
254  timeOfArrival = std::make_optional<double>((locToGlob*locPos).mag() * inv_c);
255  }
256  data.nIter = minimizer.NCalls();
257  data.calibMeasurements = c2f.release(xs);
258 
259  auto [chiPerMeas, finalChi2] = SegmentFitHelpers::postFitChi2PerMas(data.segmentPars, timeOfArrival,
260  data.calibMeasurements, msgStream());
261  data.chi2PerMeasurement = std::move(chiPerMeas);
262  data.chi2 = finalChi2;
263  data.converged = true;
264  }
265  return data;
266  }

◆ fitSegmentSeed()

std::vector< std::unique_ptr< Segment > > MuonR4::SegmentFittingAlg::fitSegmentSeed ( const EventContext &  ctx,
const ActsGeometryContext 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

Draw the prefit

Definition at line 268 of file SegmentFittingAlg.cxx.

270  {
271 
272  const Amg::Transform3D& locToGlob{patternSeed->msSector()->localToGlobalTrans(gctx)};
273  std::vector<std::unique_ptr<Segment>> segments{};
274 
275  MdtSegmentSeedGenerator::Config genCfg{};
276  genCfg.hitPullCut = m_seedHitChi2;
277  genCfg.recalibSeedCircles = m_recalibSeed;
278  genCfg.fastSeedFit = m_refineSeed;
279  genCfg.calibrator = m_calibTool.get();
280 
281 
283  genCfg.busyLayerLimit = 2 + 2*(patternSeed->parameters()[toInt(ParamDefs::theta)] > 50 * Gaudi::Units::deg);
285  if (m_visionTool.isEnabled()) {
286  PrimitiveVec seedLines{};
287  MdtSegmentSeedGenerator drawMe{name(), patternSeed, genCfg};
288  while(auto s = drawMe.nextSeed(ctx)) {
289  seedLines.push_back(drawLine(s->parameters, -Gaudi::Units::m, Gaudi::Units::m, kViolet));
290  }
291  seedLines.push_back(drawLabel(std::format("possible seeds: {:d}", drawMe.numGenerated()), 0.15, 0.85, 14));
292  m_visionTool->visualizeSeed(ctx, *patternSeed, "pattern", std::move(seedLines));
293  }
294 
295  MdtSegmentSeedGenerator seedGen{name(), patternSeed, std::move(genCfg)};
296  while (auto seed = seedGen.nextSeed(ctx)) {
297  SegmentFitResult data{};
298  data.segmentPars = seed->parameters;
299  data.calibMeasurements = std::move(seed->measurements);
301  if (m_visionTool.isEnabled()) {
302  auto seedCopy = convertToSegment(locToGlob, patternSeed, copy(data));
303  m_visionTool->visualizeSegment(ctx, *seedCopy, std::format("Pre fit {:d}", seedGen.numGenerated()));
304  }
305  data = fitSegmentHits(ctx, gctx, seed->parameters, std::move(data.calibMeasurements));
306  data.nIter += seed->nIter;
307  if (m_visionTool.isEnabled() && data.converged) {
308  auto seedCopy = convertToSegment(locToGlob, patternSeed, copy(data));
309  m_visionTool->visualizeSegment(ctx, *seedCopy, std::format("Intermediate fit {:d}", seedGen.numGenerated()));
310  }
311  if (!removeOutliers(ctx, gctx, *patternSeed, data)) {
312  continue;
313  }
314  if (!plugHoles(ctx, gctx, *patternSeed, data)) {
315  continue;
316  }
317  if (m_visionTool.isEnabled()) {
318  auto seedCopy = convertToSegment(locToGlob, patternSeed, copy(data));
319  m_visionTool->visualizeSegment(ctx, *seedCopy, std::format("Final fit {:d}", seedGen.numGenerated()));
320  }
321  segments.push_back(convertToSegment(locToGlob, patternSeed, std::move(data)));
322  }
323  return segments;
324  }

◆ initialize()

StatusCode MuonR4::SegmentFittingAlg::initialize ( )
overridevirtual

Definition at line 63 of file SegmentFittingAlg.cxx.

63  {
65  ATH_CHECK(m_seedKey.initialize());
66  ATH_CHECK(m_outSegments.initialize());
67  ATH_CHECK(m_calibTool.retrieve());
68  ATH_CHECK(m_idHelperSvc.retrieve());
69  ATH_CHECK(m_visionTool.retrieve(EnableTool{!m_visionTool.empty()}));
70  SegmentAmbiSolver::Config cfg{};
71  m_ambiSolver = std::make_unique<SegmentAmbiSolver>(name(), std::move(cfg));
72  return StatusCode::SUCCESS;
73  }

◆ 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()

bool AthReentrantAlgorithm::isClonable ( ) const
overridevirtualinherited

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ 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.

◆ plugHoles()

bool MuonR4::SegmentFittingAlg::plugHoles ( const EventContext &  ctx,
const ActsGeometryContext gctx,
const SegmentSeed seed,
SegmentFitResult toRecover 
) const
private

Recovery of missed hits.

Hits in the space point bucket that are maximally <RecoveryPull> away from the fitted segment are put onto the segment candidate and the candidate is refitted. If the refitted candidate has a chi2/nDoF < <OutlierRemoval> the canidate is automatically choosen otherwise, its chi needs to be better.

Parameters
ctxEventContext needed for calibration of the hits
gctxGeometry context needed if the beamspot constaint will be packed onto the segment
seedSegment seed from the pattern recognition to access the underlying bucket
toRecoverFit result with parameters & hits to recover.

We've the first estimator of the segment fit

Setup a map to replace space points if they better suite

Hit is already used in the segment fit

Remove the beamspot constraint measurement

Nothing has been recovered. Just bail out

If the chi2 is less than 5, no outlier rejection is launched. So also accept any recovered segment below that threshold

Next check whether the recovery made measurements marked as outlier feasable for the hole recovery

Finally remove all hits from the calib measurements which are obvious outliers

Definition at line 409 of file SegmentFittingAlg.cxx.

412  {
414  ATH_MSG_VERBOSE("plugHoles() -- segment "<<toString(beforeRecov.segmentPars)
415  <<", chi2: "<<beforeRecov.chi2<<", nDoF: "<<beforeRecov.nDoF<<", "
416  <<beforeRecov.chi2 /std::max(beforeRecov.nDoF, 1) );
418  std::unordered_set<const SpacePoint*> usedSpacePoint{};
419  for (const HitVec::value_type& hit : beforeRecov.calibMeasurements) {
420  usedSpacePoint.insert(hit->spacePoint());
421  }
422 
423  HitVec candidateHits{};
424  SpacePointPerLayerSorter hitLayers{*seed.parentBucket()};
425  bool hasCandidate{false};
426  const auto [locPos, locDir] = beforeRecov.makeLine();
427  for (const std::vector<HoughHitType>& mdtLayer : hitLayers.mdtHits()) {
428  for (const SpacePoint* mdtHit: mdtLayer) {
430  if (usedSpacePoint.count(mdtHit)) {
431  continue;
432  }
433  const double dist = Amg::lineDistance(locPos, locDir, mdtHit->positionInChamber(), mdtHit->directionInChamber());
434  const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(mdtHit->primaryMeasurement());
435  if (dist >= dc->readoutElement()->innerTubeRadius()) {
436  continue;
437  }
438  HitVec::value_type calibHit{m_calibTool->calibrate(ctx, mdtHit, locPos, locDir, beforeRecov.segmentPars[toInt(ParamDefs::time)])};
439  const double pull = std::sqrt(SegmentFitHelpers::chiSqTermMdt(locPos, locDir, *calibHit, msgStream()));
440  ATH_MSG_VERBOSE(__func__<<"() :"<<__LINE__<<" Candidate hit for recovery "<<m_idHelperSvc->toString(mdtHit->identify())<<", chi2: "<<pull);
441  if (pull <= m_recoveryPull) {
442  hasCandidate |= calibHit->fitState() == CalibratedSpacePoint::State::Valid;
443  candidateHits.push_back(std::move(calibHit));
444  } else {
445  calibHit->setFitState(CalibratedSpacePoint::State::Outlier);
446  candidateHits.push_back(std::move(calibHit));
447  }
448  }
449  }
450  if (!hasCandidate) {
451  ATH_MSG_VERBOSE("No space point candidates for recovery were found");
452  beforeRecov.calibMeasurements.insert(beforeRecov.calibMeasurements.end(),
453  std::make_move_iterator(candidateHits.begin()),
454  std::make_move_iterator(candidateHits.end()));
455  eraseWrongHits(gctx, beforeRecov);
456  return beforeRecov.nDoF > 0;
457  }
458 
459  HitVec copied = copy(beforeRecov.calibMeasurements), copiedCandidates = copy(candidateHits);
462  removeBeamSpot(copied);
463  }
464 
465  candidateHits.insert(candidateHits.end(), std::make_move_iterator(copied.begin()), std::make_move_iterator(copied.end()));
466 
467  SegmentFitResult recovered = fitSegmentHits(ctx, gctx, beforeRecov.segmentPars, std::move(candidateHits));
468  if (!recovered.converged) {
469  return false;
470  }
472  if (recovered.nDoF + recovered.timeFit <= beforeRecov.nDoF + beforeRecov.timeFit) {
473  for (HitVec::value_type& hit : copiedCandidates) {
474  hit->setFitState(CalibratedSpacePoint::State::Outlier);
475  beforeRecov.calibMeasurements.push_back(std::move(hit));
476  }
477  eraseWrongHits(gctx, beforeRecov);
478  return true;
479  }
480  ATH_MSG_VERBOSE("Chi2, nDOF before:"<<beforeRecov.chi2<<", "<<beforeRecov.nDoF<<" after recovery: "<<recovered.chi2<<", "<<recovered.nDoF);
481  double redChi2 = recovered.chi2 / std::max(recovered.nDoF,1);
483  if (redChi2 < m_outlierRemovalCut || (beforeRecov.nDoF == 0) || redChi2 < beforeRecov.chi2 / beforeRecov.nDoF) {
484  ATH_MSG_VERBOSE("Accept segment with recovered "<<(recovered.nDoF + recovered.timeFit) - (beforeRecov.nDoF + beforeRecov.timeFit)<<" hits.");
485  recovered.nIter += beforeRecov.nIter;
486  beforeRecov = std::move(recovered);
488  while (true) {
489  bool runAnotherTrial = false;
490  copied = copy(beforeRecov.calibMeasurements);
492  removeBeamSpot(copied);
493  }
494  for (unsigned int m = 0; m < beforeRecov.calibMeasurements.size(); ++m) {
495  if (beforeRecov.calibMeasurements[m]->fitState() == CalibratedSpacePoint::State::Outlier &&
496  std::sqrt(beforeRecov.chi2PerMeasurement[m]) < m_recoveryPull) {
497  copied[m]->setFitState(CalibratedSpacePoint::State::Valid);
498  runAnotherTrial = true;
499  }
500  }
501  if (!runAnotherTrial) {
502  break;
503  }
504  recovered = fitSegmentHits(ctx, gctx, beforeRecov.segmentPars, std::move(copied));
505  if (!recovered.converged) {
506  break;
507  }
508  if (recovered.nDoF + recovered.timeFit <= beforeRecov.nDoF + beforeRecov.timeFit) {
509  break;
510  }
511  redChi2 = recovered.chi2 / std::max(recovered.nDoF, 1);
512  if (redChi2 < m_outlierRemovalCut || redChi2 < beforeRecov.chi2 / beforeRecov.nDoF) {
513  recovered.nIter += beforeRecov.nIter;
514  beforeRecov = std::move(recovered);
515  } else {
516  break;
517  }
518  }
520  eraseWrongHits(gctx, beforeRecov);
521  } else{
522  for (HitVec::value_type& hit : copiedCandidates) {
523  hit->setFitState(CalibratedSpacePoint::State::Outlier);
524  beforeRecov.calibMeasurements.push_back(std::move(hit));
525  }
526  }
527  return true;
528  }

◆ removeOutliers()

bool MuonR4::SegmentFittingAlg::removeOutliers ( const EventContext &  ctx,
const ActsGeometryContext gctx,
const SegmentSeed seed,
SegmentFitResult fitResult 
) const
private

Spot hits with large discrepancy from the estimated parameters and remove them from the list.

Parameters
ctxEventContext needed for hit calibration
gctxGeometry context needed if the beamspot constaint will be packed onto the segment
fitResultData structure carrying the fit parameters & calibrated hits

If no degree of freedom is in the segment fit then try to plug the holes

Remove a priori the beamspot constaint as it never should pose any problem and another one will be added anyway in the next iteration

Next sort the measurements by chi2

Declare the hit with the largest chi2 as outlier.

Remove the last measurement as it has the largest discrepancy

Definition at line 348 of file SegmentFittingAlg.cxx.

351  {
352 
354  if (data.nDoF<=0 || data.calibMeasurements.empty()) {
355  ATH_MSG_VERBOSE("No degree of freedom available. What shall be removed?!");
356  return false;
357  }
358 
359  const auto [segPos, segDir] = data.makeLine();
360 
361  if (data.converged && data.chi2 / data.nDoF < m_outlierRemovalCut) {
362  ATH_MSG_VERBOSE("The segment "<<Amg::toString(segPos)<<" + "<<Amg::toString(segDir)
363  <<" is already of good quality "<<data.chi2 / std::max(data.nDoF, 1)
364  <<". Don't remove outliers");
365  return true;
366  }
367  ATH_MSG_VERBOSE("Segment "<<toString(data.segmentPars)<<" is of badish quality.");
370  if (m_doBeamspotConstraint && removeBeamSpot(data.calibMeasurements)) {
371  data.nDoF-=2;
372  data.nPhiMeas-=1;
373  }
374 
376  std::sort(data.calibMeasurements.begin(), data.calibMeasurements.end(),
377  [&, this](const HitVec::value_type& a, const HitVec::value_type& b){
378  return SegmentFitHelpers::chiSqTerm(segPos, segDir, data.segmentPars[toInt(ParamDefs::time)], std::nullopt, *a, msgStream()) <
379  SegmentFitHelpers::chiSqTerm(segPos, segDir, data.segmentPars[toInt(ParamDefs::time)], std::nullopt, *b, msgStream());
380  });
381 
383  data.calibMeasurements.back()->setFitState(CalibratedSpacePoint::State::Outlier);
384  data.nDoF -= data.calibMeasurements.back()->measuresEta();
385  data.nDoF -= data.calibMeasurements.back()->measuresPhi();
386  if (m_doT0Fit && data.calibMeasurements.back()->measuresTime() &&
387  data.calibMeasurements.back()->type() != xAOD::UncalibMeasType::MdtDriftCircleType) {
388  --data.nDoF;
389  }
391  std::vector<HoughHitType> uncalib{};
392  for (const HitVec::value_type& calib : data.calibMeasurements) {
393  uncalib.push_back(calib->spacePoint());
394  }
395  SegmentFitResult newAttempt = fitSegmentHits(ctx, gctx, data.segmentPars, std::move(data.calibMeasurements));
396  if (newAttempt.converged) {
397  newAttempt.nIter+=data.nIter;
398  data = std::move(newAttempt);
399  if (m_visionTool.isEnabled()) {
400  auto seedCopy = convertToSegment(seed.msSector()->localToGlobalTrans(gctx), &seed, copy(data));
401  m_visionTool->visualizeSegment(ctx, *seedCopy, "Bad fit recovery");
402  }
403  } else {
404  data.calibMeasurements = std::move(newAttempt.calibMeasurements);
405  }
406  return removeOutliers(ctx, gctx, seed, data);
407  }

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
366  }

◆ resolveAmbiguities()

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

Definition at line 558 of file SegmentFittingAlg.cxx.

559  {
560  using SegmentVec = std::vector<std::unique_ptr<Segment>>;
561  ATH_MSG_VERBOSE("Resolve ambiguities amongst "<<segmentCandidates.size()<<" segment candidates. ");
562  std::unordered_map<const MuonGMR4::SpectrometerSector*, SegmentVec> candidatesPerChamber{};
563 
564  for (std::unique_ptr<Segment>& sortMe : segmentCandidates) {
565  const MuonGMR4::SpectrometerSector* chamb = sortMe->msSector();
566  candidatesPerChamber[chamb].push_back(std::move(sortMe));
567  }
568  segmentCandidates.clear();
569  for (auto& [chamber, resolveMe] : candidatesPerChamber) {
570  SegmentVec resolvedSegments = m_ambiSolver->resolveAmbiguity(gctx, std::move(resolveMe));
571  segmentCandidates.insert(segmentCandidates.end(),
572  std::make_move_iterator(resolvedSegments.begin()),
573  std::make_move_iterator(resolvedSegments.end()));
574  }
575  }

◆ retrieveContainer()

template<class ContainerType >
StatusCode MuonR4::SegmentFittingAlg::retrieveContainer ( const EventContext &  ctx,
const SG::ReadHandleKey< ContainerType > &  key,
const ContainerType *&  contToPush 
) const
private

Helper method to fetch data from StoreGate.

If the key is empty, a nullptr is assigned to the container ptr Failure is returned in cases, of non-empty keys and failed retrieval

Definition at line 131 of file SegmentFittingAlg.cxx.

133  {
134  contToPush = nullptr;
135  if (key.empty()) {
136  ATH_MSG_VERBOSE("No key has been parsed for object "<< typeid(ContainerType).name());
137  return StatusCode::SUCCESS;
138  }
139  SG::ReadHandle readHandle{key, ctx};
140  ATH_CHECK(readHandle.isPresent());
141  contToPush = readHandle.cptr();
142  return StatusCode::SUCCESS;
143  }

◆ setFilterPassed()

virtual void AthReentrantAlgorithm::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 139 of file AthReentrantAlgorithm.h.

139  {
140  execState( ctx ).setFilterPassed( state );
141  }

◆ sysExecute()

StatusCode AthReentrantAlgorithm::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 67 of file AthReentrantAlgorithm.cxx.

68 {
69  return Gaudi::Algorithm::sysExecute (ctx);
70 }

◆ sysInitialize()

StatusCode AthReentrantAlgorithm::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 InputMakerBase, and HypoBase.

Definition at line 96 of file AthReentrantAlgorithm.cxx.

96  {
98 
99  if (sc.isFailure()) {
100  return sc;
101  }
102 
103  ServiceHandle<ICondSvc> cs("CondSvc",name());
104  for (auto h : outputHandles()) {
105  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
106  // do this inside the loop so we don't create the CondSvc until needed
107  if ( cs.retrieve().isFailure() ) {
108  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
109  return StatusCode::SUCCESS;
110  }
111  if (cs->regHandle(this,*h).isFailure()) {
112  sc = StatusCode::FAILURE;
113  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
114  << " with CondSvc");
115  }
116  }
117  }
118  return sc;
119 }

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_ambiSolver

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

Definition at line 139 of file SegmentFittingAlg.h.

◆ m_beamSpotL

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

Definition at line 124 of file SegmentFittingAlg.h.

◆ m_beamSpotR

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

Definition at line 123 of file SegmentFittingAlg.h.

◆ m_calibTool

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

Handle to the space point calibrator.

Definition at line 113 of file SegmentFittingAlg.h.

◆ 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 122 of file SegmentFittingAlg.h.

◆ m_doT0Fit

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

Definition at line 120 of file SegmentFittingAlg.h.

◆ 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 AthReentrantAlgorithm::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 153 of file AthReentrantAlgorithm.h.

◆ m_geoCtxKey

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

Definition at line 109 of file SegmentFittingAlg.h.

◆ m_idHelperSvc

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

IdHelperSvc.

Definition at line 111 of file SegmentFittingAlg.h.

◆ 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 136 of file SegmentFittingAlg.h.

◆ m_outSegments

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

Definition at line 107 of file SegmentFittingAlg.h.

◆ 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 131 of file SegmentFittingAlg.h.

◆ m_recoveryPull

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

Definition at line 137 of file SegmentFittingAlg.h.

◆ m_refineSeed

Gaudi::Property<bool> MuonR4::SegmentFittingAlg::m_refineSeed {this, "SeedRefine", false}
private

Toggle seed refit.

The segment seed is fastly refitted using the collected seed drift circles

Definition at line 134 of file SegmentFittingAlg.h.

◆ 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 128 of file SegmentFittingAlg.h.

◆ m_seedKey

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

ReadHandle of the seeds.

Definition at line 105 of file SegmentFittingAlg.h.

◆ m_useMinuit

Gaudi::Property<bool> MuonR4::SegmentFittingAlg::m_useMinuit {this, "useMinuit", false}
private

Toggle the fitter.

Definition at line 118 of file SegmentFittingAlg.h.

◆ 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 115 of file SegmentFittingAlg.h.


The documentation for this class was generated from the following files:
MuonR4::PrimitiveVec
MuonValR4::IPatternVisualizationTool::PrimitiveVec PrimitiveVec
Definition: SegmentFittingAlg.cxx:60
MuonR4::inv_c
constexpr double inv_c
Definition: SegmentFittingAlg.cxx:32
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
LArSamples::FitterData::fitter
const ShapeFitter * fitter
Definition: ShapeFitter.cxx:23
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
MuonR4::SegmentFittingAlg::m_outlierRemovalCut
Gaudi::Property< double > m_outlierRemovalCut
Cut on the segment chi2 / nDoF to launch the outlier removal.
Definition: SegmentFittingAlg.h:136
MuonR4::SegmentFittingAlg::m_outSegments
SG::WriteHandleKey< SegmentContainer > m_outSegments
Definition: SegmentFittingAlg.h:107
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
MuonR4::SegmentFittingAlg::convertToSegment
static std::unique_ptr< Segment > convertToSegment(const Amg::Transform3D &locToGlobTrf, const SegmentSeed *parentSeed, SegmentFitResult &&toConvert)
Converts the fit result into a segment object.
Definition: SegmentFittingAlg.cxx:325
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
max
#define max(a, b)
Definition: cfImp.cxx:41
MuonGMR4::SpectrometerSector
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
Definition: SpectrometerSector.h:39
vtune_athena.format
format
Definition: vtune_athena.py:14
MuonR4::SegmentFittingAlg::m_recoveryPull
Gaudi::Property< double > m_recoveryPull
Definition: SegmentFittingAlg.h:137
MuonR4::SegmentFittingAlg::m_beamSpotL
Gaudi::Property< double > m_beamSpotL
Definition: SegmentFittingAlg.h:124
MuonR4::SegmentFitHelpers::postFitChi2PerMas
std::pair< std::vector< double >, double > postFitChi2PerMas(const SegmentFit::Parameters &segPars, std::optional< double > arrivalTime, std::vector< std::unique_ptr< CalibratedSpacePoint >> &hits, MsgStream &msg)
Calculates the chi2 per measurement and the chi2 itself after the fit is finished.
Definition: SegmentFitHelperFunctions.cxx:250
MuonR4::SegmentFittingAlg::eraseWrongHits
void eraseWrongHits(const ActsGeometryContext &gctx, SegmentFitResult &candidate) const
Removes all hits from the segment which are obvious outliers.
Definition: SegmentFittingAlg.cxx:529
calibdata.chamber
chamber
Definition: calibdata.py:32
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
MuonR4::SegmentFittingAlg::fitSegmentHits
SegmentFitResult fitSegmentHits(const EventContext &ctx, const ActsGeometryContext &gctx, const Parameters &startPars, SegmentFitResult::HitVec &&calibHits) const
Executes the segment fit with start parameters.
Definition: SegmentFittingAlg.cxx:145
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
AthCommonDataStore::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 > renounce(T &h)
Definition: AthCommonDataStore.h:380
MuonR4::SegmentFittingAlg::m_useMinuit
Gaudi::Property< bool > m_useMinuit
Toggle the fitter.
Definition: SegmentFittingAlg.h:118
MuonR4::SegmentFittingAlg::m_beamSpotR
Gaudi::Property< double > m_beamSpotR
Definition: SegmentFittingAlg.h:123
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
deg
#define deg
Definition: SbPolyhedron.cxx:17
MuonR4::SegmentFittingAlg::HitVec
SegmentFitResult::HitVec HitVec
Definition: SegmentFittingAlg.h:38
MuonR4::SegmentFittingAlg::m_doT0Fit
Gaudi::Property< bool > m_doT0Fit
Definition: SegmentFittingAlg.h:120
MuonR4::CalibratedSpacePoint::State::Outlier
@ Outlier
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MuonR4::SegmentFittingAlg::Parameters
SegmentFit::Parameters Parameters
Definition: SegmentFittingAlg.h:41
MuonR4::SegmentFittingAlg::resolveAmbiguities
void resolveAmbiguities(const ActsGeometryContext &gctx, std::vector< std::unique_ptr< Segment >> &segmentCandidates) const
Definition: SegmentFittingAlg.cxx:558
MuonR4::SegmentFit::makeLine
std::pair< Amg::Vector3D, Amg::Vector3D > makeLine(const Parameters &pars)
Returns the parsed parameters into an Eigen line parametrization.
Definition: SegmentFitterEventData.cxx:30
MuonValR4::drawLabel
std::unique_ptr< TLatex > drawLabel(const std::string &text, const double xPos, const double yPos, const unsigned int fontSize=18)
Create a TLatex label,.
Definition: VisualizationHelpers.cxx:22
MuonR4::toString
std::string toString(const CalibratedSpacePoint::Covariance_t &mat)
Returns the matrix in string.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx:75
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
MuonR4::SegmentFit::ParamDefs::phi
@ phi
MuonR4::SegmentFittingAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc.
Definition: SegmentFittingAlg.h:111
SpacePoint
Definition: Trigger/TrigAccel/TrigCudaFitter/src/SpacePoint.h:7
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
MuonR4::SegmentFittingAlg::m_ambiSolver
std::unique_ptr< SegmentAmbiSolver > m_ambiSolver
Definition: SegmentFittingAlg.h:139
MuonR4::SegmentFittingAlg::m_calibTool
ToolHandle< ISpacePointCalibrator > m_calibTool
Handle to the space point calibrator.
Definition: SegmentFittingAlg.h:113
MuonR4::SegmentFitHelpers::driftSign
int driftSign(const Amg::Vector3D &posInChamber, const Amg::Vector3D &dirInChamber, const SpacePoint &uncalibHit, MsgStream &msg)
Calculates whether a segement line travereses the tube measurement on the left (-1) or right (1) side...
Definition: SegmentFitHelperFunctions.cxx:221
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
MuonR4::Segment::MeasType
std::unique_ptr< CalibratedSpacePoint > MeasType
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:22
MuonR4::copy
MuonR4::SegmentFitResult::HitVec copy(const MuonR4::SegmentFitResult::HitVec &hits)
Definition: SegmentFittingAlg.cxx:35
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
MuonR4::SegmentFittingAlg::fitSegmentSeed
std::vector< std::unique_ptr< Segment > > fitSegmentSeed(const EventContext &ctx, const ActsGeometryContext &gctx, const SegmentSeed *seed) const
Definition: SegmentFittingAlg.cxx:268
AthCommonDataStore
Definition: AthCommonDataStore.h:52
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MuonR4::SegmentFittingAlg::plugHoles
bool plugHoles(const EventContext &ctx, const ActsGeometryContext &gctx, const SegmentSeed &seed, SegmentFitResult &toRecover) const
Recovery of missed hits.
Definition: SegmentFittingAlg.cxx:409
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
MuonR4::SegmentFittingAlg::m_seedHitChi2
Gaudi::Property< double > m_seedHitChi2
Two mdt seeds are the same if their defining parameters match wihin.
Definition: SegmentFittingAlg.h:128
MuonR4::SegmentFitHelpers::chiSqTermMdt
double chiSqTermMdt(const Amg::Vector3D &posInChamber, const Amg::Vector3D &dirInChamber, const SpacePoint &measurement, MsgStream &msg)
Calculates the chi2 contribuation to a linear segment line from an uncalibrated Mdt measurement.
Definition: SegmentFitHelperFunctions.cxx:49
MuonR4::SegmentFittingAlg::removeOutliers
bool removeOutliers(const EventContext &ctx, const ActsGeometryContext &gctx, const SegmentSeed &seed, SegmentFitResult &fitResult) const
Spot hits with large discrepancy from the estimated parameters and remove them from the list.
Definition: SegmentFittingAlg.cxx:348
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
dumpNswErrorDb.linear
def linear
Definition: dumpNswErrorDb.py:23
xAOD::Other
@ Other
python.StandardJetMods.pull
pull
Definition: StandardJetMods.py:282
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
MuonR4::removeBeamSpot
bool removeBeamSpot(MuonR4::SegmentFitResult::HitVec &hits)
Definition: SegmentFittingAlg.cxx:51
MuonR4::SegmentFit::ParamDefs::x0
@ x0
MuonR4::SegmentFittingAlg::m_recalibSeed
Gaudi::Property< bool > m_recalibSeed
Toggle seed recalibration.
Definition: SegmentFittingAlg.h:131
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
AthReentrantAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthReentrantAlgorithm.h:153
MuonR4::SegmentFit::ParamDefs::time
@ time
MuonR4::CalibratedSpacePoint::State::Valid
@ Valid
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
MuonR4::SegmentFit::ParamDefs::y0
@ y0
MuonR4::SegmentFittingAlg::m_doBeamspotConstraint
Gaudi::Property< bool > m_doBeamspotConstraint
Add beamline constraint.
Definition: SegmentFittingAlg.h:122
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuonR4::SegmentFittingAlg::m_seedKey
SG::ReadHandleKey< SegmentSeedContainer > m_seedKey
ReadHandle of the seeds.
Definition: SegmentFittingAlg.h:105
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
MuonR4::SegmentFit::toInt
constexpr int toInt(const ParamDefs p)
Definition: MuonHoughDefs.h:42
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
MuonR4::SegmentSeedContainer
DataVector< SegmentSeed > SegmentSeedContainer
Definition: MuonPatternContainer.h:15
MuonR4::SegmentFittingAlg::m_refineSeed
Gaudi::Property< bool > m_refineSeed
Toggle seed refit.
Definition: SegmentFittingAlg.h:134
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
MuonR4::SegmentFittingAlg::retrieveContainer
StatusCode retrieveContainer(const EventContext &ctx, const SG::ReadHandleKey< ContainerType > &key, const ContainerType *&contToPush) const
Helper method to fetch data from StoreGate.
Definition: SegmentFittingAlg.cxx:131
Amg::lineDistance
double lineDistance(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the shortest distance between two lines posA: offset point of line A dirA: orientation of ...
Definition: GeoPrimitivesHelpers.h:303
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.copyTCTOutput.locDir
locDir
Definition: copyTCTOutput.py:113
PlotSFuncertainty.calib
calib
Definition: PlotSFuncertainty.py:110
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
MuonR4::SegmentVec
SegmentAmbiSolver::SegmentVec SegmentVec
Definition: SegmentAmbiSolver.cxx:10
a
TList * a
Definition: liststreamerinfos.cxx:10
h
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
MuonR4::SegmentFit::localSegmentPars
Parameters localSegmentPars(const xAOD::MuonSegment &seg)
Returns the localSegPars decoration from a xAODMuon::Segment.
Definition: SegmentFitterEventData.cxx:36
python.BuildSignatureFlags.beamSpot
AthConfigFlags beamSpot(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:454
MuonR4::SegmentFittingAlg::m_visionTool
ToolHandle< MuonValR4::IPatternVisualizationTool > m_visionTool
Pattern visualization tool.
Definition: SegmentFittingAlg.h:115
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
drawLine
void drawLine(std::ostream &os)
Definition: PrintMC.cxx:16
MuonR4::SegmentFittingAlg::m_geoCtxKey
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Definition: SegmentFittingAlg.h:109
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
xAOD::MdtDriftCircle_v1
https://gitlab.cern.ch/atlas/athena/-/blob/master/MuonSpectrometer/MuonReconstruction/MuonRecEvent/Mu...
Definition: MdtDriftCircle_v1.h:21
MuonR4::AmgSymMatrix
const AmgSymMatrix(2) &SpacePoint
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:150
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:26
MuonR4::SegmentFit::ParamDefs::theta
@ theta
fitman.k
k
Definition: fitman.py:528
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
ServiceHandle< ICondSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37