ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Trk::GaussianSumFitter Class Referencefinal

#include <GaussianSumFitter.h>

Inheritance diagram for Trk::GaussianSumFitter:
Collaboration diagram for Trk::GaussianSumFitter:

Public Types

using GSFTrajectory = std::vector< GSFTsos >
 

Public Member Functions

 GaussianSumFitter (const std::string &, const std::string &, const IInterface *)
 Constructor with parameters to be passed to AlgTool. More...
 
virtual ~GaussianSumFitter ()=default
 Virtual destructor. More...
 
virtual StatusCode initialize () override final
 AlgTool initialise method. More...
 
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 sysInitialize () override
 Perform system initialization for an algorithm. 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, V, H > &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
 
Inteface method. The main one are the ones taking

Measurement or Raw Data inputs. The rest are implemented on top of these two. We follow the ITrackFitter interface but not all arguements are meaningfull

We do not implement outlier remove. Actually by default we try to re-integrate possible outliers from non-GSF fits.

The material effects actually applied are determined by the dedicated configured GsfExtrapolator.

virtual std::unique_ptr< Trackfit (const EventContext &ctx, const PrepRawDataSet &, const TrackParameters &, const RunOutlierRemoval, const ParticleHypothesis) const override final
 Fit a collection of 'PrepRawData' objects using the Gaussian Sum Filter. More...
 
virtual std::unique_ptr< Trackfit (const EventContext &ctx, const MeasurementSet &, const TrackParameters &, const RunOutlierRemoval, const ParticleHypothesis particleHypothesis) const override final
 Fit a collection of 'RIO_OnTrack' objects using the Gaussian Sum Filter. More...
 
virtual std::unique_ptr< Trackfit (const EventContext &ctx, const Track &, const RunOutlierRemoval, const ParticleHypothesis) const override final
 Refit a track. More...
 
virtual std::unique_ptr< Trackfit (const EventContext &ctx, const Track &, const PrepRawDataSet &, const RunOutlierRemoval, const ParticleHypothesis) const override final
 Refit a track adding a PrepRawDataSet. More...
 
virtual std::unique_ptr< Trackfit (const EventContext &ctx, const Track &, const MeasurementSet &, const RunOutlierRemoval, const ParticleHypothesis) const override final
 Refit a track adding a measurement base set. More...
 
virtual std::unique_ptr< Trackfit (const EventContext &ctx, const Track &, const Track &, const RunOutlierRemoval, const ParticleHypothesis) const override final
 Combine two tracks by refitting their measurements. More...
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

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

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 
Helper methods
std::unique_ptr< MultiComponentStateOnSurfaceDVconvertTrajToTrack (GSFTrajectory &trajectory) const
 Helper to convert the GSFTrajectory to a Trk::Track. More...
 
GSFTsos makePerigee (const EventContext &ctx, Trk::IMultiStateExtrapolator::Cache &, const GSFTrajectory &smoothedTrajectory) const
 Produces a perigee from a smoothed trajectory. More...
 
bool addCCOT (const EventContext &ctx, const Trk::CaloCluster_OnTrack *ccot, GSFTrajectory &smoothedTrajectory) const
 Methof to add the CaloCluster onto the track. More...
 
Actual implementation of the GSF formalism
template<typename T >
GSFTrajectory forwardFit (const EventContext &ctx, IMultiStateExtrapolator::Cache &cache, const T &inputSet, const TrackParameters &estimatedTrackParametersNearOrigin) const
 Forward GSF fit. More...
 
template<typename T >
bool stepForwardFit (const EventContext &ctx, IMultiStateExtrapolator::Cache &, GSFTrajectory &forwardTrajectory, const T *measurement, const Surface &surface, MultiComponentState &updatedState) const
 Progress one step along the forward fit. More...
 
GSFTrajectory smootherFit (const EventContext &ctx, Trk::IMultiStateExtrapolator::Cache &, GSFTrajectory &forwardTrajectory, const CaloCluster_OnTrack *ccot=nullptr) const
 Gsf smoothed trajectory. More...
 

Private Attributes

ToolHandle< IMultiStateExtrapolatorm_extrapolator
 
ToolHandle< IRIO_OnTrackCreatorm_rioOnTrackCreator
 
Gaudi::Property< bool > m_reintegrateOutliers
 
Gaudi::Property< bool > m_refitOnMeasurementBase
 
Gaudi::Property< bool > m_combineWithFitter
 
Gaudi::Property< bool > m_useMode
 
Gaudi::Property< bool > m_slimTransientMTSOS
 
Gaudi::Property< double > m_cutChiSquaredPerNumberDOF
 
Gaudi::Property< unsigned int > m_maximumNumberOfComponents
 
DoubleArrayProperty m_smootherCovFactors
 
TrkParametersComparisonFunction m_trkParametersComparisonFunction
 
Trk::ParticleHypothesis m_particleHypothesis = Trk::electron
 
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

Definition at line 44 of file GaussianSumFitter.h.

Member Typedef Documentation

◆ GSFTrajectory

Definition at line 124 of file GaussianSumFitter.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ GaussianSumFitter()

Trk::GaussianSumFitter::GaussianSumFitter ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Constructor with parameters to be passed to AlgTool.

Definition at line 161 of file GaussianSumFitter.cxx.

166 {
167  declareInterface<ITrackFitter>(this);
168 }

◆ ~GaussianSumFitter()

virtual Trk::GaussianSumFitter::~GaussianSumFitter ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ addCCOT()

bool Trk::GaussianSumFitter::addCCOT ( const EventContext &  ctx,
const Trk::CaloCluster_OnTrack ccot,
GSFTrajectory smoothedTrajectory 
) const
private

Methof to add the CaloCluster onto the track.

special method to account for possible additional measurement from the calorimeter

Definition at line 765 of file GaussianSumFitter.cxx.

769 {
770  const GSFTsos& currentMultiStateOS = smoothedTrajectory.back();
771  if (!ccot) {
772  return false;
773  }
774  const auto& currentMultiComponentState = currentMultiStateOS.multiComponentState;
775  const Trk::MeasurementBase* measurement = currentMultiStateOS.measurementOnTrack.get();
776  if (!measurement) {
777  return false;
778  }
779  const Trk::Surface& currentSurface = measurement->associatedSurface();
780 
781  //Create a ccot that we will own. So we use it to build our own TSOS
782  auto ownCCOT = ccot->uniqueClone();
783  // Extrapolate to the Calo to get prediction
784  Trk::MultiComponentState extrapolatedToCaloState = m_extrapolator->extrapolateDirectly(
785  ctx, currentMultiComponentState, ownCCOT->associatedSurface(),
786  Trk::alongMomentum, false);
787 
788  if (extrapolatedToCaloState.empty()) {
789  return false;
790  }
791  // Update newly extrapolated state with measurement
793  Trk::MultiComponentState updatedStateAtCalo =
794  Trk::GsfMeasurementUpdator::update(std::move(extrapolatedToCaloState),
795  *ownCCOT, fitQuality);
796  if (updatedStateAtCalo.empty()) {
797  return false;
798  }
799 
800  // Extrapolate back to the surface near the origin
801  auto improvedState = m_extrapolator->extrapolateDirectly(
802  ctx, updatedStateAtCalo, currentSurface, Trk::oppositeMomentum,
803  false);
804 
805  if (improvedState.empty()) {
806  return false;
807  }
808  // Combine the improved state after extrapolating back from the calo
809  // and find the mode of the distribution
810  std::unique_ptr<Trk::TrackParameters> combinedSingleState =
812 
813  // Now build a dummy measurement for the improved estimation
815  covMatrix.setZero();
816  covMatrix(0, 0) = 1e6;
818  Trk::LocalParameters locpars(locX);
820  std::move(locpars), std::move(covMatrix), currentSurface);
821 
822  // Build TSOS at the surface of calo
823  smoothedTrajectory.emplace_back(
824  fitQuality,
825  std::move(ownCCOT),
826  nullptr,
827  std::move(updatedStateAtCalo));
828 
829  // Build a TSOS using the dummy measurement and and the final combined state
830  smoothedTrajectory.emplace_back(
831  FitQualityOnSurface{},
832  // We do not add the fitquality again. As this would be the one we
833  // add at calo. Here not a real measurement
834  std::move(pseudoMeasurement),
835  std::move(combinedSingleState),
836  std::move(improvedState));
837 
838  return true;
839 }

◆ convertTrajToTrack()

std::unique_ptr< MultiComponentStateOnSurfaceDV > Trk::GaussianSumFitter::convertTrajToTrack ( GSFTrajectory trajectory) const
private

Helper to convert the GSFTrajectory to a Trk::Track.

Definition at line 500 of file GaussianSumFitter.cxx.

501  {
502  const bool slimTransientMTSOS = m_slimTransientMTSOS;
503  auto MTSOS = std::make_unique<MultiComponentStateOnSurfaceDV>();
504  MTSOS->reserve(trajectory.size());
505  for (GSFTsos& state : trajectory) {
506  MTSOS->push_back(state.convert(slimTransientMTSOS));
507  }
508  return MTSOS;
509 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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< AlgTool > >::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  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::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; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ fit() [1/6]

std::unique_ptr< Trk::Track > Trk::GaussianSumFitter::fit ( const EventContext &  ctx,
const MeasurementSet measurementSet,
const TrackParameters estimatedParametersNearOrigin,
const  RunOutlierRemoval,
const ParticleHypothesis  particleHypothesis 
) const
finaloverridevirtual

Fit a collection of 'RIO_OnTrack' objects using the Gaussian Sum Filter.

Interface method Fitting of a set of MeasurementBase objects This is the main method for MeasurementBase fitting.

  • This requires that an trackParameters object be supplied also as an initial guess

Implements Trk::ITrackFitter.

Definition at line 411 of file GaussianSumFitter.cxx.

417 {
418  if (measurementSet.size() < 3) {
419  ATH_MSG_WARNING("Requesting fit with less than 3 Measurements!!!");
420  return nullptr;
421  }
422  // We need to separate the possible CaloCluster on Track
423  // measurement from the rest
424  const Trk::CaloCluster_OnTrack* ccot(nullptr);
425 
426  Trk::MeasurementSet cleanedMeasurementSet;
427  cleanedMeasurementSet.reserve(measurementSet.size());
428 
429  for (const auto* meas : measurementSet) {
430  if (!meas) {
431  ATH_MSG_WARNING("There is an empty MeasurementBase object ! ");
432  continue;
433  }
435  ccot = static_cast<const Trk::CaloCluster_OnTrack*>(meas);
436  } else {
437  cleanedMeasurementSet.push_back(meas);
438  }
439  }
440 
441  // We need a sorted measurement set
442  Trk::MeasurementSet sortedMeasurementSet =
443  MeasurementSet(cleanedMeasurementSet);
444 
446  measurementBaseComparisonFunction(
447  estimatedParametersNearOrigin.position(),
448  estimatedParametersNearOrigin.momentum());
449  sort(sortedMeasurementSet.begin(), sortedMeasurementSet.end(),
450  measurementBaseComparisonFunction);
451 
452  // Create Extrapolator cache that holds material effects cache;
453  Trk::IMultiStateExtrapolator::Cache extrapolatorCache;
454 
455  // Perform GSF forwards fit
456  GSFTrajectory forwardTrajectory =
457  forwardFit(ctx, extrapolatorCache, sortedMeasurementSet,
458  estimatedParametersNearOrigin);
459 
460  if (forwardTrajectory.empty()) {
461  return nullptr;
462  }
463 
464  // Perform GSF smoother operation
465  GSFTrajectory smoothedTrajectory = smootherFit(
466  ctx, extrapolatorCache, forwardTrajectory, ccot);
467  if (smoothedTrajectory.empty()) {
468  return nullptr;
469  }
470 
471  // fit quality
472  std::unique_ptr<FitQuality> fitQuality = buildFitQuality(smoothedTrajectory);
473  if (!fitQuality) {
474  return nullptr;
475  }
476 
477  // Create parameters at perigee if needed
478  auto perigeeMultiStateOnSurface = makePerigee(
479  ctx, extrapolatorCache, smoothedTrajectory);
480  if (!perigeeMultiStateOnSurface.multiComponentState.empty()) {
481  smoothedTrajectory.push_back(std::move(perigeeMultiStateOnSurface));
482  } else {
483  return nullptr;
484  }
485 
486  // Reverse the order of the TSOS's to make be order flow from inside to out
487  std::reverse(smoothedTrajectory.begin(), smoothedTrajectory.end());
488 
489  // Create track
491  info.setTrackProperties(TrackInfo::BremFit);
492  info.setTrackProperties(TrackInfo::BremFitSuccessful);
493  return std::make_unique<Track>(info, convertTrajToTrack(smoothedTrajectory),
494  std::move(fitQuality));
495 }

◆ fit() [2/6]

std::unique_ptr< Trk::Track > Trk::GaussianSumFitter::fit ( const EventContext &  ctx,
const PrepRawDataSet prepRawDataSet,
const TrackParameters estimatedParametersNearOrigin,
const  RunOutlierRemoval,
const  ParticleHypothesis 
) const
finaloverridevirtual

Fit a collection of 'PrepRawData' objects using the Gaussian Sum Filter.

Interface Method Fitting of a set of PrepRawData objects This is the main method for PrepRawData fitting.

  • This requires that an trackParameters object be supplied also as an initial guess

Implements Trk::ITrackFitter.

Definition at line 341 of file GaussianSumFitter.cxx.

347 {
348  if (prepRawDataSet.size() < 3) {
349  ATH_MSG_WARNING("Requesting Fit with less than three prep Raw Data!!!");
350  return nullptr;
351  }
352  // We need a sorted PrepRawDataSet
353  Trk::PrepRawDataSet sortedPrepRawDataSet = PrepRawDataSet(prepRawDataSet);
354  const Trk::PrepRawDataComparisonFunction prdComparisonFunction =
356  estimatedParametersNearOrigin.position(),
357  estimatedParametersNearOrigin.momentum());
358 
359  std::sort(sortedPrepRawDataSet.begin(), sortedPrepRawDataSet.end(),
360  prdComparisonFunction);
361 
362  // Create Extrapolator cache that holds material effects cache;
363  Trk::IMultiStateExtrapolator::Cache extrapolatorCache;
364  // Perform GSF forward fit
365  GSFTrajectory forwardTrajectory =
366  forwardFit(ctx, extrapolatorCache, sortedPrepRawDataSet,
367  estimatedParametersNearOrigin);
368 
369  if (forwardTrajectory.empty()) {
370  return nullptr;
371  }
372  // Perform GSF smoother operation
373  GSFTrajectory smoothedTrajectory = smootherFit(
374  ctx, extrapolatorCache, forwardTrajectory);
375  if (smoothedTrajectory.empty()) {
376  return nullptr;
377  }
378 
379  // Fit quality
380  std::unique_ptr<FitQuality> fitQuality = buildFitQuality(smoothedTrajectory);
381  if (!fitQuality) {
382  return nullptr;
383  }
384 
385  // Create parameters at perigee if needed
386  auto perigeeMultiStateOnSurface = makePerigee(
387  ctx, extrapolatorCache, smoothedTrajectory);
388  if (!perigeeMultiStateOnSurface.multiComponentState.empty()) {
389  smoothedTrajectory.push_back(std::move(perigeeMultiStateOnSurface));
390  } else {
391  return nullptr;
392  }
393 
394  // Reverse the order of the TSOS's after the smoother
395  // to make be order flow from inside to out
396  std::reverse(smoothedTrajectory.begin(), smoothedTrajectory.end());
397 
398  // Create Trk::Track
400  info.setTrackProperties(TrackInfo::BremFit);
401  info.setTrackProperties(TrackInfo::BremFitSuccessful);
402  return std::make_unique<Track>(info, convertTrajToTrack(smoothedTrajectory),
403  std::move(fitQuality));
404 }

◆ fit() [3/6]

std::unique_ptr< Trk::Track > Trk::GaussianSumFitter::fit ( const EventContext &  ctx,
const Track inputTrack,
const MeasurementSet addSet,
const RunOutlierRemoval  runOutlier,
const ParticleHypothesis  matEffects 
) const
finaloverridevirtual

Refit a track adding a measurement base set.

Interface method Refit a track adding a RIO_OnTrack set.

Implements Trk::ITrackFitter.

Definition at line 269 of file GaussianSumFitter.cxx.

274 {
275  // Check that the input track has well defined parameters
276  if (inputTrack.trackParameters()->empty()) {
277  ATH_MSG_FATAL("No estimation of track parameters near origin!");
278  return nullptr;
279  }
280  // Check that the input track has associated MeasurementBase objects
281  if (inputTrack.trackStateOnSurfaces()->empty()) {
283  "Attempting to fit track to empty MeasurementBase "
284  "collection!");
285  return nullptr;
286  }
287  // Retrieve the set of track parameters closest to the reference point
288  const Trk::TrackParameters* paramNearestRef = *(std::min_element(
289  inputTrack.trackParameters()->begin(),
290  inputTrack.trackParameters()->end(), m_trkParametersComparisonFunction));
291 
292  MeasurementSet measurementSet =
293  stripMeasurements(inputTrack, &addSet, m_reintegrateOutliers);
294  return fit(ctx, measurementSet, *paramNearestRef, runOutlier, matEffects);
295 }

◆ fit() [4/6]

std::unique_ptr< Trk::Track > Trk::GaussianSumFitter::fit ( const EventContext &  ctx,
const Track intrk,
const PrepRawDataSet addPrdColl,
const RunOutlierRemoval  runOutlier,
const ParticleHypothesis  matEffects 
) const
finaloverridevirtual

Refit a track adding a PrepRawDataSet.

Interface method Refit a track adding a PrepRawData set.

Implements Trk::ITrackFitter.

Definition at line 240 of file GaussianSumFitter.cxx.

245 {
246  // Check that the input track has well defined parameters
247  if (intrk.trackParameters()->empty()) {
248  ATH_MSG_FATAL("No track parameters on Track!");
249  return nullptr;
250  }
251  // Check that the input track has associated MeasurementBase objects
252  if (intrk.trackStateOnSurfaces()->empty()) {
253  ATH_MSG_FATAL("Empty MeasurementBase ");
254  return nullptr;
255  }
256  // determine the Track Parameter closest to the reference
257  const TrackParameters* paramNearestRef = *(std::min_element(
258  intrk.trackParameters()->begin(), intrk.trackParameters()->end(),
260  PrepRawDataSet prepRawDataSet =
261  stripPrepRawData(intrk, &addPrdColl, m_reintegrateOutliers);
262  return fit(ctx, prepRawDataSet, *paramNearestRef, runOutlier, matEffects);
263 }

◆ fit() [5/6]

std::unique_ptr< Trk::Track > Trk::GaussianSumFitter::fit ( const EventContext &  ctx,
const Track inputTrack,
const  RunOutlierRemoval,
const  ParticleHypothesis 
) const
finaloverridevirtual

Refit a track.

Interface Method Refitting of an input track.

Extract the measurementBase or PrepRawData and refit.

Implements Trk::ITrackFitter.

Definition at line 200 of file GaussianSumFitter.cxx.

205 {
206  // Check that the input track has well defined parameters
207  if (inputTrack.trackParameters()->empty()) {
208  ATH_MSG_FATAL("No track parameters on Track!");
209  return nullptr;
210  }
211  // Check that the input track has associated MeasurementBase objects
212  if (inputTrack.trackStateOnSurfaces()->empty()) {
213  ATH_MSG_FATAL("Empty MeasurementBase ");
214  return nullptr;
215  }
216  // Retrieve the set of track parameters closest to the reference point
217  const Trk::TrackParameters* paramNearestRef =
218  *(std::min_element(inputTrack.trackParameters()->begin(),
219  inputTrack.trackParameters()->end(),
221 
222  // Rrefit using measurement base then
224  MeasurementSet measurementSet =
225  stripMeasurements(inputTrack, nullptr, m_reintegrateOutliers);
226  return fit(ctx, measurementSet, *paramNearestRef, outlierRemoval,
227  particleHypothesis);
228  }
229  // Refit using PrepRawData level then
230  PrepRawDataSet prepRawDataSet =
231  stripPrepRawData(inputTrack, nullptr, m_reintegrateOutliers);
232  return fit(ctx, prepRawDataSet, *paramNearestRef, outlierRemoval,
233  particleHypothesis);
234 }

◆ fit() [6/6]

std::unique_ptr< Trk::Track > Trk::GaussianSumFitter::fit ( const EventContext &  ctx,
const Track intrk1,
const Track intrk2,
const RunOutlierRemoval  runOutlier,
const ParticleHypothesis  matEffects 
) const
finaloverridevirtual

Combine two tracks by refitting their measurements.

@bried Interface method to Combine two tracks by their measurement

Implements Trk::ITrackFitter.

Definition at line 301 of file GaussianSumFitter.cxx.

306  {
307  // protection against not having measurements on the input tracks
308  if (!intrk1.trackStateOnSurfaces() || !intrk2.trackStateOnSurfaces() ||
309  intrk1.trackStateOnSurfaces()->size() < 2) {
311  "called to refit empty track or track with too little "
312  "information, reject fit");
313  return nullptr;
314  }
315  if (!intrk1.trackParameters() || intrk1.trackParameters()->empty()) {
317  "input #1 fails to provide track parameters for "
318  "seeding the GXF, reject fit");
319  return nullptr;
320  }
321  // Here we assume that the reference paramrs are the beginning
322  // of the 1st track.
323  const TrackParameters* minPar = *(intrk1.trackParameters()->begin());
324  MeasurementSet measurementSet1 =
325  stripMeasurements(intrk1, nullptr, m_reintegrateOutliers);
326  MeasurementSet measurementSet2 =
327  stripMeasurements(intrk2, nullptr, m_reintegrateOutliers);
328 
329  for (const auto* meas : measurementSet2) {
330  measurementSet1.push_back(meas);
331  }
332 
333  return fit(ctx, measurementSet1, *minPar, runOutlier, matEffects);
334 }

◆ forwardFit()

template<typename T >
GSFTrajectory Trk::GaussianSumFitter::forwardFit ( const EventContext &  ctx,
IMultiStateExtrapolator::Cache cache,
const T &  inputSet,
const TrackParameters estimatedTrackParametersNearOrigin 
) const
private

Forward GSF fit.

◆ initialize()

StatusCode Trk::GaussianSumFitter::initialize ( )
finaloverridevirtual

AlgTool initialise method.

Definition at line 171 of file GaussianSumFitter.cxx.

172 {
173 
175  ATH_MSG_FATAL("Requested MaximumNumberOfComponents > "
177  return StatusCode::FAILURE;
178  }
179  // GSF extrapolator
180  ATH_CHECK(m_extrapolator.retrieve());
181  // We need a to create RIO_OnTrack (calibrated/corrected)
182  // measurements only if we start from PrePRawData.
184  ATH_CHECK(m_rioOnTrackCreator.retrieve());
185  } else {
186  m_rioOnTrackCreator.disable();
187  }
188  // Initialise the closest track parameters search algorithm
189  const Amg::Vector3D referencePosition(0, 0, 0);
191  m_particleHypothesis = m_extrapolator->particleHypothesis();
192  return StatusCode::SUCCESS;
193 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ interfaceID()

static const InterfaceID& Trk::ITrackFitter::interfaceID ( )
inlinestaticinherited

Definition at line 45 of file ITrackFitter.h.

46  {
47  return IID_ITrackFitter;
48  }

◆ makePerigee()

GSFTsos Trk::GaussianSumFitter::makePerigee ( const EventContext &  ctx,
Trk::IMultiStateExtrapolator::Cache extrapolatorCache,
const GSFTrajectory smoothedTrajectory 
) const
private

Produces a perigee from a smoothed trajectory.

Helper creating a multicomponent perigee TrackStateOnSurface.

Definition at line 515 of file GaussianSumFitter.cxx.

519 {
520 
521  // Start at the end of the smoothed trajectory
522  // we should be the closest to perigee/origin.
523  const GSFTsos&
524  multiComponentStateOnSurfaceNearestOrigin = smoothedTrajectory.back();
525  const Trk::MultiComponentState* multiComponentState =
526  &(multiComponentStateOnSurfaceNearestOrigin.multiComponentState);
527 
528  // Extrapolate to perigee
529  const Trk::PerigeeSurface perigeeSurface;
530  Trk::MultiComponentState stateExtrapolatedToPerigee =
531  m_extrapolator->extrapolate(ctx,
532  extrapolatorCache,
533  *multiComponentState,
534  perigeeSurface,
536  false);
537 
538  if (stateExtrapolatedToPerigee.empty()) {
539  return {};
540  }
541 
542  // Determine the combined state
543  std::unique_ptr<Trk::TrackParameters> combinedPerigee =
544  MultiComponentStateCombiner::combineToSingle(stateExtrapolatedToPerigee, m_useMode);
545 
546  // Perigee is an additional MultiComponentStateOnSurface
547  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes>
548  pattern(0);
550 
551  if(std::abs(combinedPerigee->position().z())>5000.) {
552  ATH_MSG_WARNING("Pathological perigee well outside of tracking detector!! Returning {}");
553  return {};
554  }
555 
556  if (std::abs(combinedPerigee->parameters()[Trk::qOverP]) > 1e8) {
558  "makePerigee() about to return with 0 momentum!! Returning {}");
559  return {};
560  }
561 
562  return {Trk::FitQualityOnSurface{},
563  nullptr,
564  std::move(combinedPerigee),
565  std::move(stateExtrapolatedToPerigee),
566  pattern};
567 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::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< AlgTool >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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  }

◆ smootherFit()

Trk::GaussianSumFitter::GSFTrajectory Trk::GaussianSumFitter::smootherFit ( const EventContext &  ctx,
Trk::IMultiStateExtrapolator::Cache extrapolatorCache,
GSFTrajectory forwardTrajectory,
const CaloCluster_OnTrack ccot = nullptr 
) const
private

Gsf smoothed trajectory.

This method can handle additional info like calorimeter cluster constraints. It also produces what we actually store in Trk::Tracks.

Definition at line 585 of file GaussianSumFitter.cxx.

590 {
591  if (forwardTrajectory.empty()) {
593  "Attempting to smooth an empty forward trajectory... Exiting!");
594  return {};
595  }
596 
597  GSFTrajectory smoothedTrajectory;
598  smoothedTrajectory.reserve(forwardTrajectory.size());
599  // For the smoother we start from the end and we go
600  // back. We need to find the the first track
601  // state on surface in this reverse direction
602  auto trackStateOnSurfaceItr = forwardTrajectory.rbegin();
603  bool foundMeasurement = false;
604  for (; trackStateOnSurfaceItr != forwardTrajectory.rend(); ++trackStateOnSurfaceItr) {
605  if (!(*trackStateOnSurfaceItr).typeFlags.test(TrackStateOnSurface::Measurement)) {
606  smoothedTrajectory.emplace_back(std::move(*trackStateOnSurfaceItr));
607  } else {
608  foundMeasurement = true;
609  break;
610  }
611  }
612  if(!foundMeasurement){
613  return {};
614  }
615  // This is the 1st track state on surface for a measurement
616  // in the reverse direction. Our starting point for the smoother
617  auto smootherPredictionMultiState = std::move(trackStateOnSurfaceItr->multiComponentState);
618  // Perform an update with the measurement.
619  // This will be the first entry in the trajectory
620  std::unique_ptr<Trk::MeasurementBase> firstSmootherMeasurementOnTrack =
621  std::move(trackStateOnSurfaceItr->measurementOnTrack);
622  if (!firstSmootherMeasurementOnTrack) {
624  "Initial state on surface in smoother does not have an associated "
625  "MeasurementBase object");
626  return {};
627  }
629  Trk::MultiComponentState firstSmoothedState =
630  Trk::GsfMeasurementUpdator::update(std::move(smootherPredictionMultiState),
631  *firstSmootherMeasurementOnTrack,
632  fitQuality);
633  if (firstSmoothedState.empty()) {
634  return {};
635  }
636  if (!MultiComponentStateHelpers::allHaveCovariance(firstSmoothedState)) {
638  "Not all components have covariance. Rejecting smoothed state.");
639  return {};
640  }
641  // The first in reverse (last in normal order) TSOS is also special
642  // for the EDM. Sso we also a proper collapse
643  // of the multi component to single TrackParameter
644  std::unique_ptr<Trk::TrackParameters> combinedFirstSmoothedState =
646  m_useMode);
647  smoothedTrajectory.emplace_back(
648  fitQuality, std::move(firstSmootherMeasurementOnTrack),
649  std::move(combinedFirstSmoothedState),
650  MultiComponentStateHelpers::clone(firstSmoothedState));
651  const auto& updatedFirstStateOnSurface = smoothedTrajectory.back();
652  //
653  // Now we are ready to proceed
654  // Generate a prediction with an inflated covariance of all components
655  // in the first smoothed state.
656  // This way there is no dependance on error of prediction
657  //
658  // NB local Y and theta need care due to TRT.
659  //
660  Trk::MultiComponentState smoothedStateWithScaledError =
662  std::move(firstSmoothedState), m_smootherCovFactors[0],
665  // Do the 1st update using the state with inflated covariance.
666  Trk::FitQualityOnSurface fitQualityWithScaledErrors;
668  std::move(smoothedStateWithScaledError),
669  *(updatedFirstStateOnSurface.measurementOnTrack),
670  fitQualityWithScaledErrors);
671  if (updatedState.empty()) {
672  ATH_MSG_WARNING("Smoother prediction could not be determined");
673  return {};
674  }
675  // loopUpdatedState points to the most recent predicted MultiComponentState.
676  Trk::MultiComponentState* loopUpdatedState = &updatedState;
677  // Increase reverse iterator by one.
678  ++trackStateOnSurfaceItr;
679  // The is the last one we will see as we go back.
680  auto lasttrackStateOnSurface = forwardTrajectory.rend() - 1;
681  // And this is the pre-last
682  auto secondLastTrackStateOnSurface = forwardTrajectory.rend() - 2;
683  //Loop
684  for (; trackStateOnSurfaceItr != forwardTrajectory.rend();++trackStateOnSurfaceItr) {
685  auto& trackStateOnSurface = (*trackStateOnSurfaceItr);
686  // Retrieve the MeasurementBase object from the TrackStateOnSurface object
687  auto measurement = std::move(trackStateOnSurface.measurementOnTrack);
688  if (!measurement) {
689  ATH_MSG_WARNING("MeasurementBase object could not be extracted from a "
690  "measurement TSOS...continuing");
691  continue;
692  }
693  // Create prediction for the next measurement surface.
694  // For the smoother the direction of propagation
695  // is opposite to the direction of momentum
696  Trk::MultiComponentState extrapolatedState = m_extrapolator->extrapolate(
697  ctx, extrapolatorCache, (*loopUpdatedState),
698  measurement->associatedSurface(), Trk::oppositeMomentum, false);
699 
700  if (extrapolatedState.empty()) {
701  return {};
702  }
703  // Handle the case where Original measurement was flagged as an outlier.
704  if (!trackStateOnSurface.typeFlags.test(TrackStateOnSurface::Measurement)) {
705  std::bitset<TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> type(
706  0);
708  smoothedTrajectory.emplace_back(FitQualityOnSurface(1, 1),
709  std::move(measurement), nullptr,
710  std::move(extrapolatedState), type);
711  loopUpdatedState = &(smoothedTrajectory.back().multiComponentState);
712  continue;
713  }
714  // Update with the measurement
715  updatedState = Trk::GsfMeasurementUpdator::update(
716  std::move(extrapolatedState), *measurement, fitQuality);
717  if (updatedState.empty()) {
718  ATH_MSG_WARNING("Could not update the multi-component state");
719  return {};
720  }
721  // last in reverse (first in normal order) is special for the EDM
722  const bool islast = (trackStateOnSurfaceItr == lasttrackStateOnSurface);
723  if (m_combineWithFitter) {
724  // Optional combine smoother state with fitter state
725  const Trk::MultiComponentState& forwardsMultiState =
726  trackStateOnSurface.multiComponentState;
727  Trk::MultiComponentState combinedfitterState =
728  Trk::TwoStateCombiner::combine(forwardsMultiState, updatedState,
730  if (combinedfitterState.empty()) {
732  "Could not combine state from forward fit with "
733  "smoother state");
734  return {};
735  }
736  auto combinedFitQuality = Trk::GsfMeasurementUpdator::fitQuality(
737  combinedfitterState, *measurement);
738  smoothedTrajectory.emplace_back(
739  smootherHelper(std::move(combinedfitterState), std::move(measurement),
740  combinedFitQuality, islast, m_useMode));
741  } else {
742  // If combination with forwards state is not done
743  smoothedTrajectory.emplace_back(
744  smootherHelper(std::move(updatedState), std::move(measurement),
745  fitQuality, islast, m_useMode));
746  }
747  // Handle adding measurement from calo if it is present
748  if (ccot && trackStateOnSurfaceItr == secondLastTrackStateOnSurface) {
749  if (!addCCOT(ctx, ccot, smoothedTrajectory)) {
750  ATH_MSG_WARNING("Could not add Calo Cluster On Track Measurement");
751  return {};
752  }
753  }
754  // For the next iteration start from last added
755  loopUpdatedState = &(smoothedTrajectory.back().multiComponentState);
756  } // End for loop over all components
757  return smoothedTrajectory;
758 }

◆ stepForwardFit()

template<typename T >
bool Trk::GaussianSumFitter::stepForwardFit ( const EventContext &  ctx,
IMultiStateExtrapolator::Cache ,
GSFTrajectory forwardTrajectory,
const T *  measurement,
const Surface surface,
MultiComponentState updatedState 
) const
private

Progress one step along the forward fit.

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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_combineWithFitter

Gaudi::Property<bool> Trk::GaussianSumFitter::m_combineWithFitter
private
Initial value:
{
this, "CombineStateWithFitter", false,
"Combine with forwards state during Smoothing"}

Definition at line 189 of file GaussianSumFitter.h.

◆ m_cutChiSquaredPerNumberDOF

Gaudi::Property<double> Trk::GaussianSumFitter::m_cutChiSquaredPerNumberDOF
private
Initial value:
{
this, "StateChi2PerNDOFCut", 50., "Cut on Chi2 per NDOF"}

Definition at line 202 of file GaussianSumFitter.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extrapolator

ToolHandle<IMultiStateExtrapolator> Trk::GaussianSumFitter::m_extrapolator
private
Initial value:
{
this, "ToolForExtrapolation", "Trk::GsfExtrapolator/GsfExtrapolator", ""}

Definition at line 176 of file GaussianSumFitter.h.

◆ m_maximumNumberOfComponents

Gaudi::Property<unsigned int> Trk::GaussianSumFitter::m_maximumNumberOfComponents
private
Initial value:
{
this, "MaximumNumberOfComponents", 12, "Maximum number of components"}

Definition at line 205 of file GaussianSumFitter.h.

◆ m_particleHypothesis

Trk::ParticleHypothesis Trk::GaussianSumFitter::m_particleHypothesis = Trk::electron
private

Definition at line 216 of file GaussianSumFitter.h.

◆ m_refitOnMeasurementBase

Gaudi::Property<bool> Trk::GaussianSumFitter::m_refitOnMeasurementBase
private
Initial value:
{
this, "RefitOnMeasurementBase", true, "Refit On Measurement Base"}

Definition at line 186 of file GaussianSumFitter.h.

◆ m_reintegrateOutliers

Gaudi::Property<bool> Trk::GaussianSumFitter::m_reintegrateOutliers
private
Initial value:
{this, "ReintegrateOutliers", true,
"Reintegrate Outliers"}

Definition at line 183 of file GaussianSumFitter.h.

◆ m_rioOnTrackCreator

ToolHandle<IRIO_OnTrackCreator> Trk::GaussianSumFitter::m_rioOnTrackCreator
private
Initial value:
{
this, "ToolForROTCreation", "",
"Tool for converting Raw Data to measurements"}

Definition at line 179 of file GaussianSumFitter.h.

◆ m_slimTransientMTSOS

Gaudi::Property<bool> Trk::GaussianSumFitter::m_slimTransientMTSOS
private
Initial value:
{
this, "slimTransientMTSOS", true,
"Slim the transient MTSOS . Keeping just the combined state and not all "
"components"}

Definition at line 197 of file GaussianSumFitter.h.

◆ m_smootherCovFactors

DoubleArrayProperty Trk::GaussianSumFitter::m_smootherCovFactors
private
Initial value:
{
this,
"smootherStartCovFactors",
{15., 5., 15., 5., 15.},
"Inflation factors for the covariance at the start of smoothing [LocX, LocY, phi, "
"theta, q / p]"}

Definition at line 208 of file GaussianSumFitter.h.

◆ m_trkParametersComparisonFunction

TrkParametersComparisonFunction Trk::GaussianSumFitter::m_trkParametersComparisonFunction
private

Definition at line 215 of file GaussianSumFitter.h.

◆ m_useMode

Gaudi::Property<bool> Trk::GaussianSumFitter::m_useMode
private
Initial value:
{
this, "useMode", true,
"Collapse MultiComponent States using Mode rather than Mean"}

Definition at line 193 of file GaussianSumFitter.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:25
Trk::MultiComponentStateHelpers::allHaveCovariance
bool allHaveCovariance(const MultiComponentState &in)
Check to see if all components have covariance Matrix.
Definition: ComponentParameters.cxx:66
Trk::TrackInfo
Contains information about the 'fitter' of this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:32
Trk::TrackStateOnSurface::Perigee
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
Definition: TrackStateOnSurface.h:117
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Trk::TrackInfo::GaussianSumFilter
@ GaussianSumFilter
Tracks from Gaussian Sum Filter.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:53
Trk::PrepRawDataSet
std::vector< const PrepRawData * > PrepRawDataSet
vector of clusters and drift circles
Definition: FitterTypes.h:26
Trk::locX
@ locX
Definition: ParamDefs.h:37
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
Trk::oppositeMomentum
@ oppositeMomentum
Definition: PropDirection.h:21
Trk::GaussianSumFitter::m_slimTransientMTSOS
Gaudi::Property< bool > m_slimTransientMTSOS
Definition: GaussianSumFitter.h:197
Trk::MeasurementBaseType::CaloCluster_OnTrack
@ CaloCluster_OnTrack
Definition: MeasurementBase.h:53
Trk::TrackInfo::BremFitSuccessful
@ BremFitSuccessful
A brem fit was performed on this track and this fit was successful.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:81
Trk::GaussianSumFitter::convertTrajToTrack
std::unique_ptr< MultiComponentStateOnSurfaceDV > convertTrajToTrack(GSFTrajectory &trajectory) const
Helper to convert the GSFTrajectory to a Trk::Track.
Definition: GaussianSumFitter.cxx:500
Trk::GaussianSumFitter::m_extrapolator
ToolHandle< IMultiStateExtrapolator > m_extrapolator
Definition: GaussianSumFitter.h:176
Trk::TwoStateCombiner::combine
Trk::MultiComponentState combine(const Trk::MultiComponentState &forwardsMultiState, const Trk::MultiComponentState &smootherMultiState, unsigned int maximumNumberOfComponents)
Helper to combine forward with smoother MultiComponentStates.
Definition: TwoStateCombiner.cxx:149
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trk::GaussianSumFitter::smootherFit
GSFTrajectory smootherFit(const EventContext &ctx, Trk::IMultiStateExtrapolator::Cache &, GSFTrajectory &forwardTrajectory, const CaloCluster_OnTrack *ccot=nullptr) const
Gsf smoothed trajectory.
Definition: GaussianSumFitter.cxx:585
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
Trk::MultiComponentStateCombiner::combineToSingle
std::unique_ptr< Trk::TrackParameters > combineToSingle(const MultiComponentState &, const bool useMode=false)
@bried Calculate combined state of many components
Definition: MultiComponentStateCombiner.cxx:190
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Trk::GaussianSumFitter::forwardFit
GSFTrajectory forwardFit(const EventContext &ctx, IMultiStateExtrapolator::Cache &cache, const T &inputSet, const TrackParameters &estimatedTrackParametersNearOrigin) const
Forward GSF fit.
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:554
Trk::DefinedParameter
std::pair< double, ParamDefs > DefinedParameter
Definition: DefinedParameter.h:27
Trk::GaussianSumFitter::GSFTrajectory
std::vector< GSFTsos > GSFTrajectory
Definition: GaussianSumFitter.h:124
DeMoUpdate.reverse
reverse
Definition: DeMoUpdate.py:563
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trk::TrackStateOnSurface::Outlier
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Definition: TrackStateOnSurface.h:122
GSFConstants::maxNumberofStateComponents
constexpr int8_t maxNumberofStateComponents
The state is described by N Gaussian components The Beth Heitler Material effect are also described b...
Definition: GsfConstants.h:43
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
Trk::GaussianSumFitter::makePerigee
GSFTsos makePerigee(const EventContext &ctx, Trk::IMultiStateExtrapolator::Cache &, const GSFTrajectory &smoothedTrajectory) const
Produces a perigee from a smoothed trajectory.
Definition: GaussianSumFitter.cxx:515
Trk::GaussianSumFitter::m_refitOnMeasurementBase
Gaudi::Property< bool > m_refitOnMeasurementBase
Definition: GaussianSumFitter.h:186
Trk::GaussianSumFitter::fit
virtual std::unique_ptr< Track > fit(const EventContext &ctx, const PrepRawDataSet &, const TrackParameters &, const RunOutlierRemoval, const ParticleHypothesis) const override final
Fit a collection of 'PrepRawData' objects using the Gaussian Sum Filter.
Definition: GaussianSumFitter.cxx:341
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
Trk::FitQualityOnSurface
Definition: FitQualityOnSurface.h:19
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::CaloCluster_OnTrack::uniqueClone
std::unique_ptr< CaloCluster_OnTrack > uniqueClone() const
NVI Clone giving up unique pointer.
Definition: CaloCluster_OnTrack.h:58
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
xAOD::covMatrix
covMatrix
Definition: TrackMeasurement_v1.cxx:19
GSFTsos::measurementOnTrack
std::unique_ptr< Trk::MeasurementBase > measurementOnTrack
Definition: GSFTsos.h:24
Trk::MultiComponentStateHelpers::clone
MultiComponentState clone(const MultiComponentState &in)
Clone TrackParameters method.
Definition: ComponentParameters.cxx:15
Trk::GaussianSumFitter::m_smootherCovFactors
DoubleArrayProperty m_smootherCovFactors
Definition: GaussianSumFitter.h:208
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trk::MultiComponentState
std::vector< ComponentParameters > MultiComponentState
Definition: ComponentParameters.h:27
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::TrackInfo::BremFit
@ BremFit
A brem fit was performed on this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:78
Trk::ParametersBase
Definition: ParametersBase.h:55
Trk::IMultiStateExtrapolator::Cache
MultiStateExtrapolator cache class.
Definition: IMultiStateExtrapolator.h:51
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
GSFTsos
Definition: GSFTsos.h:17
Trk::MultiComponentStateHelpers::WithScaledError
MultiComponentState WithScaledError(MultiComponentState &&in, double errorScaleLocX, double errorScaleLocY, double errorScalePhi, double errorScaleTheta, double errorScaleQoverP)
Scale the covariance matrix components by individual factors.
Definition: ComponentParameters.cxx:26
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
Trk::MeasurementSet
std::vector< const MeasurementBase * > MeasurementSet
vector of fittable measurements
Definition: FitterTypes.h:30
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk::GaussianSumFitter::m_useMode
Gaudi::Property< bool > m_useMode
Definition: GaussianSumFitter.h:193
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
Trk::CaloCluster_OnTrack
Definition: CaloCluster_OnTrack.h:32
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
Trk::MeasurementBase::associatedSurface
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
Trk::GaussianSumFitter::addCCOT
bool addCCOT(const EventContext &ctx, const Trk::CaloCluster_OnTrack *ccot, GSFTrajectory &smoothedTrajectory) const
Methof to add the CaloCluster onto the track.
Definition: GaussianSumFitter.cxx:765
Trk::TrackParameters
ParametersBase< TrackParametersDim, Charged > TrackParameters
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:27
Trk::pseudoMeasurement
@ pseudoMeasurement
Definition: MeasurementType.h:26
Trk::GaussianSumFitter::m_particleHypothesis
Trk::ParticleHypothesis m_particleHypothesis
Definition: GaussianSumFitter.h:216
GSFTsos::multiComponentState
Trk::MultiComponentState multiComponentState
Definition: GSFTsos.h:20
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::GsfMeasurementUpdator::fitQuality
FitQualityOnSurface fitQuality(const MultiComponentState &, const MeasurementBase &)
Method for determining the chi2 of the multi-component state and the number of degrees of freedom.
Definition: GsfMeasurementUpdator.cxx:842
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
Trk::GaussianSumFitter::m_combineWithFitter
Gaudi::Property< bool > m_combineWithFitter
Definition: GaussianSumFitter.h:189
Trk::TrkParametersComparisonFunction
ComparisonFunction< TrackParameters > TrkParametersComparisonFunction
Definition: TrkParametersComparisonFunction.h:26
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
Trk::MeasurementBaseType::PseudoMeasurementOnTrack
@ PseudoMeasurementOnTrack
Definition: MeasurementBase.h:51
Trk::PrepRawDataComparisonFunction
Class providing comparison function, or relational definition, for PrepRawData.
Definition: PrepRawDataComparisonFunction.h:33
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
Trk::GaussianSumFitter::m_trkParametersComparisonFunction
TrkParametersComparisonFunction m_trkParametersComparisonFunction
Definition: GaussianSumFitter.h:215
Trk::MeasurementBaseComparisonFunction
Class implementing a comparison function for sorting MeasurementBase objects.
Definition: MeasurementBaseComparisonFunction.h:40
Trk::GsfMeasurementUpdator::update
MultiComponentState update(Trk::MultiComponentState &&, const Trk::MeasurementBase &, FitQualityOnSurface &fitQoS)
Method for updating the multi-state with a new measurement and calculate the fit qaulity at the same ...
Definition: GsfMeasurementUpdator.cxx:805
Trk::GaussianSumFitter::m_maximumNumberOfComponents
Gaudi::Property< unsigned int > m_maximumNumberOfComponents
Definition: GaussianSumFitter.h:205
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:79
Trk::GaussianSumFitter::m_reintegrateOutliers
Gaudi::Property< bool > m_reintegrateOutliers
Definition: GaussianSumFitter.h:183
Trk::GaussianSumFitter::m_rioOnTrackCreator
ToolHandle< IRIO_OnTrackCreator > m_rioOnTrackCreator
Definition: GaussianSumFitter.h:179
python.ParticleTypeUtil.info
def info
Definition: ParticleTypeUtil.py:87
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
fitman.k
k
Definition: fitman.py:528