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

GlobalTrackFitter tool providing methods used during alignment. More...

#include <iPatGlobalFitter.h>

Inheritance diagram for Trk::iPatGlobalFitter:
Collaboration diagram for Trk::iPatGlobalFitter:

Public Types

typedef IMaterialAllocator::Garbage_t Garbage_t
 

Public Member Functions

 iPatGlobalFitter (const std::string &type, const std::string &name, const IInterface *parent)
 
 ~iPatGlobalFitter (void)
 
TrackalignmentFit (AlignmentCache &, const Track &, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis matEffects=Trk::nonInteracting) const
 RE-FIT A TRACK FOR ALIGNMENT. More...
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual std::unique_ptr< Trackfit (const EventContext &ctx, const Track &, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis particleHypothesis=Trk::nonInteracting) const override
 RE-FIT A TRACK. More...
 
virtual std::unique_ptr< Trackfit (const EventContext &ctx, const Track &, const PrepRawDataSet &, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis particleHypothesis=Trk::nonInteracting) const override
 RE-FIT A TRACK, ADDING A PRD SET. More...
 
virtual std::unique_ptr< Trackfit (const EventContext &ctx, const PrepRawDataSet &, const TrackParameters &perigeeStartValue, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis particleHypothesis=Trk::nonInteracting) const override
 FIT A TRACK TO A SET OF PrepRawData. More...
 
virtual std::unique_ptr< Trackfit (const EventContext &ctx, const Track &, const MeasurementSet &, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis particleHypothesis=Trk::nonInteracting) const override
 RE-FIT A TRACK, ADDING A FITTABLE MEASUREMENT SET. More...
 
virtual std::unique_ptr< Trackfit (const EventContext &ctx, const MeasurementSet &, const TrackParameters &perigeeStartValue, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis particleHypothesis=Trk::nonInteracting) const override
 FIT A TRACK TO A SET OF MEASUREMENTBASE. More...
 
virtual std::unique_ptr< Trackfit (const EventContext &ctx, const Track &, const Track &, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis particleHypothesis=Trk::nonInteracting) const override
 COMBINE TWO TRACKS BY REFITTING. 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 > &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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Protected Member Functions

std::pair< std::unique_ptr< Track >, std::unique_ptr< FitState > > fitWithState (const EventContext &ctx, const Track &, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis particleHypothesis=Trk::nonInteracting) const
 
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...
 

Protected Attributes

std::unique_ptr< FitProcedurem_fitProcedure
 
std::mutex m_fitProcedureMutex
 
const bool m_globalFit = false
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

std::unique_ptr< Amg::MatrixXderivMatrix (const FitState &fitState) const
 GlobalTrackFitter methods: access to the matrix of derivatives used during the latest track fit. More...
 
std::unique_ptr< Amg::MatrixXfullCovarianceMatrix (const FitState &fitState) const
 access to the global fitter's full covariance matrix More...
 
void setMinIterations (int minIterations)
 set method for the minimum number of iterations for (alignment) friend More...
 
void addMeasurements (const EventContext &ctx, std::vector< FitMeasurement * > &measurements, const MeasurementSet &measurementSet, const FitParameters &parameters) const
 
bool addMeasurements (const EventContext &ctx, std::vector< FitMeasurement * > &measurements, const FitParameters &parameters, ParticleHypothesis particleHypothesis, const Trk::TrackStates &trackTSOS) const
 
std::unique_ptr< TrackperformFit (FitState &fitState, const ParticleHypothesis particleHypothesis, const TrackInfo &trackInfo, const Trk::TrackStates *leadingTSOS, const FitQuality *perigeeQuality, Garbage_t &garbage) const
 
void printTSOS (const Track &) const
 
void refit (const EventContext &ctx, FitState &fitState, const Track &track, const RunOutlierRemoval runOutlier, const ParticleHypothesis particleHypothesis) 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 int iterationsOfLastFit (const FitState &fitState)
 access to the number of iterations taken by the latest track fit More...
 

Private Attributes

bool m_allParameters
 
Gaudi::Property< bool > m_aggregateMaterial {this, "AggregateMaterial", true}
 
Gaudi::Property< bool > m_asymmetricCaloEnergy
 
Gaudi::Property< bool > m_fullCombinedFit {this, "FullCombinedFit", true}
 
Gaudi::Property< bool > m_lineFit {this, "LineFit", false}
 
Gaudi::Property< double > m_lineMomentum
 
ToolHandle< IMaterialAllocatorm_materialAllocator
 
ToolHandle< IIntersectorm_rungeKuttaIntersector
 
ToolHandle< IIntersectorm_solenoidalIntersector
 
ToolHandle< IPropagatorm_stepPropagator
 
ToolHandle< IIntersectorm_straightLineIntersector
 
ServiceHandle< ITrackingVolumesSvcm_trackingVolumesSvc
 
ToolHandle< Trk::IExtendedTrackSummaryToolm_trackSummaryTool
 
Gaudi::Property< double > m_orderingTolerance
 
Gaudi::Property< unsigned > m_maxWarnings
 
Gaudi::Property< bool > m_constrainedAlignmentEffects
 
Gaudi::Property< bool > m_extendedDebug {this, "ExtendedDebug", false}
 
Gaudi::Property< int > m_forcedRefitsForValidation
 
Gaudi::Property< int > m_maxIterations {this, "MaxIterations", 25}
 
std::unique_ptr< Trk::Volumem_calorimeterVolume
 
std::unique_ptr< Trk::Volumem_indetVolume
 
Trk::MagneticFieldProperties m_stepField
 
std::atomic< unsigned > m_countFitAttempts = 0
 
std::atomic< unsigned > m_countGoodFits = 0
 
std::atomic< unsigned > m_countIterations = 0
 
std::atomic< unsigned > m_countRefitAttempts = 0
 
std::atomic< unsigned > m_countGoodRefits = 0
 
std::atomic< unsigned > m_countRefitIterations = 0
 
std::unique_ptr< MessageHelperm_messageHelper
 
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

GlobalTrackFitter tool providing methods used during alignment.

Definition at line 26 of file iPatGlobalFitter.h.

Member Typedef Documentation

◆ Garbage_t

Definition at line 39 of file iPatFitter.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ iPatGlobalFitter()

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

Definition at line 22 of file iPatGlobalFitter.cxx.

25  : iPatFitter(type, name, parent, true), m_allParameters(false) {
26  declareInterface<IGlobalTrackFitter>(this);
27  declareProperty("AllParameters", m_allParameters);
28 }

◆ ~iPatGlobalFitter()

Trk::iPatGlobalFitter::~iPatGlobalFitter ( void  )
default

Member Function Documentation

◆ addMeasurements() [1/2]

bool Trk::iPatFitter::addMeasurements ( const EventContext &  ctx,
std::vector< FitMeasurement * > &  measurements,
const FitParameters parameters,
ParticleHypothesis  particleHypothesis,
const Trk::TrackStates trackTSOS 
) const
privateinherited

Definition at line 593 of file iPatFitter.cxx.

593  {
594  // create vector of any TSOS'es which require fitted alignment corrections
595  std::vector<Identifier> misAlignedTSOS;
596  std::vector<int> misAlignmentNumbers;
597  int misAlignmentNumber = 0;
598  int tsos = 0;
599  // BUG that shifts ... misAlignmentNumbers.push_back(misAlignmentNumber);
600  for (Trk::TrackStates::const_iterator i = trackStateOnSurfaces.begin();
601  i != trackStateOnSurfaces.end(); ++i, ++tsos) {
602  const TrackStateOnSurface& r = (**i);
603  if (!r.alignmentEffectsOnTrack() || !r.trackParameters()) {
604  continue;
605  }
606  const AlignmentEffectsOnTrack& AEOT = *r.alignmentEffectsOnTrack();
607  ++misAlignmentNumber;
608  for (const Identifier& a : AEOT.vectorOfAffectedTSOS()) {
609  misAlignedTSOS.push_back(a);
610  misAlignmentNumbers.push_back(misAlignmentNumber);
611  }
612  if (m_extendedDebug) {
614  " tsos " << tsos << " misAlignedTSOS.size() " << misAlignedTSOS.size()
615  << " misAlignmentNumber " << misAlignmentNumber
616  << " offset " << AEOT.deltaTranslation() << " +- "
617  << AEOT.sigmaDeltaTranslation() << " rotation "
618  << AEOT.deltaAngle() << " +- " << AEOT.sigmaDeltaAngle());
619  }
620  }
621 
622  // create ordered list of FitMeasurements
623  bool haveMaterial = false;
624  bool haveMeasurement = false;
625  int hit = measurements.size();
626  double previousDistance = -m_orderingTolerance;
627  double previousDistanceR = previousDistance;
628  double previousDistanceZ = previousDistance;
629  bool reorder = false;
630  const bool skipVertexMeasurement = !measurements.empty();
631  const Amg::Vector3D startDirection = parameters.direction();
632  const Amg::Vector3D& startPosition = parameters.position();
633  const TrackSurfaceIntersection& vertex = parameters.intersection();
634  TrackSurfaceIntersection intersection = vertex;
635  bool measurementsFlipped = false;
636  double qOverP = parameters.qOverP();
638  tsos = 0;
639  for (Trk::TrackStates::const_iterator i = trackStateOnSurfaces.begin();
640  i != trackStateOnSurfaces.end(); ++i, ++hit, ++tsos) {
641  const TrackStateOnSurface& s = (**i);
642  std::unique_ptr<FitMeasurement> measurement1;
643  std::unique_ptr<FitMeasurement> measurement2;
644  const Surface* surface = nullptr;
645  if (s.materialEffectsOnTrack() && s.trackParameters()) {
646  Amg::Vector3D position = s.trackParameters()->position();
647  bool calo = (!m_indetVolume->inside(position) &&
648  m_calorimeterVolume->inside(position));
649  qOverP = s.trackParameters()->parameters()[Trk::qOverP];
650  surface = &s.trackParameters()->associatedSurface();
651 
652  // skip negligibly thin scatterers (exception for CaloEnergy)
653  bool keepScatterer = true;
654  if (s.materialEffectsOnTrack()->thicknessInX0() < 0.0001) {
655  keepScatterer = false;
656  if (calo) {
657  const MaterialEffectsOnTrack* meot =
658  dynamic_cast<const MaterialEffectsOnTrack*>(
659  s.materialEffectsOnTrack());
660  if (meot) {
661  const EnergyLoss* energyLoss = meot->energyLoss();
662  if (energyLoss &&
663  std::abs(energyLoss->deltaE()) > 0.1 * Gaudi::Units::MeV) {
664  keepScatterer = true;
665  }
666  }
667  }
668  }
669  if (keepScatterer) {
670  measurement1 = std::make_unique<FitMeasurement>(
671  s.materialEffectsOnTrack(),
672  Trk::ParticleMasses::mass[particleHypothesis], position, qOverP,
673  calo);
674  if (!calo && !haveMaterial &&
675  (haveMeasurement || s.measurementOnTrack())) {
676  haveMaterial = true;
677  }
678  } else {
679  ATH_MSG_DEBUG("don't keep thin scatterer");
680  continue;
681  }
682  } else if (s.alignmentEffectsOnTrack() && s.trackParameters()) {
683  Amg::Vector3D direction = s.trackParameters()->momentum().unit();
684  Amg::Vector3D position = s.trackParameters()->position();
685  measurement1 = std::make_unique<FitMeasurement>(
686  s.alignmentEffectsOnTrack(), direction, position);
687  }
688  const Trk::MeasurementBase* measurementBase = s.measurementOnTrack();
689  if (measurementBase) {
690  if (!Amg::hasPositiveDiagElems(measurementBase->localCovariance())) {
691  continue;
692  }
693  // option to skip vertex measurement (i.e. when not at front of list)
694  if (skipVertexMeasurement &&
695  dynamic_cast<const PerigeeSurface*>(&s.surface())) {
696  measurement1.reset();
697  continue;
698  }
699  haveMeasurement = true;
700  surface = &s.measurementOnTrack()->associatedSurface();
701  measurement2 =
702  std::make_unique<FitMeasurement>(hit, nullptr, measurementBase);
703  if (s.type(TrackStateOnSurface::Outlier)) {
704  measurement2->setOutlier();
705  }
706  // redundant surely??
707  // if (measurement2->isCluster() || measurement2->isDrift())
708  // haveMeasurement = true;
709  // if (misAlignmentNumber && misAlignedTSOS.back() == *s)
710  // {
711  // measurement2->alignmentParameter(misAlignmentNumber);
712  // misAlignedTSOS.pop_back();
713  // misAlignmentNumbers.pop_back();
714  // misAlignmentNumber = misAlignmentNumbers.back();
715  // }
716  //
717  // Peter
718  // measurement2->alignmentParameter(0);
719  if (misAlignmentNumber) {
720  Identifier id = Identifier();
721  if (measurementBase) {
722  const Trk::RIO_OnTrack* rot =
723  dynamic_cast<const Trk::RIO_OnTrack*>(measurementBase);
724  if (rot) {
725  id = rot->identify();
726  } else {
728  dynamic_cast<const Muon::CompetingMuonClustersOnTrack*>(
729  measurementBase);
730  if (crot && !crot->containedROTs().empty() &&
731  crot->containedROTs().front()) {
732  id = crot->containedROTs().front()->identify();
733  }
734  }
735  }
736  for (unsigned int im = 0; im < misAlignedTSOS.size(); ++im) {
737  if (misAlignedTSOS[im] != id) {
738  continue;
739  }
740  measurement2->alignmentParameter(misAlignmentNumbers[im]);
741  }
742  if (m_extendedDebug) {
743  for (unsigned int im = 0; im < misAlignedTSOS.size(); ++im) {
744  if (misAlignedTSOS[im] != id) {
745  continue;
746  }
747  if (measurement2->isDrift()) {
748  ATH_MSG_DEBUG(" tsos " << tsos << " Drift Measurement im " << im
749  << " with misAlignmentNumber "
750  << misAlignmentNumbers[im]);
751  } else {
752  ATH_MSG_DEBUG(" tsos " << tsos << " Cluster Measurement im " << im
753  << " with misAlignmentNumber "
754  << misAlignmentNumbers[im]);
755  }
756  }
757  }
758  }
759  } else if (!measurement1 && s.trackParameters()) {
760  if (s.type(TrackStateOnSurface::Hole)) {
761  measurement2 = std::make_unique<FitMeasurement>(s);
762  } else if (s.type(TrackStateOnSurface::Perigee)) {
763  if (i == trackStateOnSurfaces.begin()) {
764  continue;
765  }
766  const Perigee* perigee =
767  dynamic_cast<const Perigee*>(s.trackParameters());
768  if (!perigee) {
769  continue;
770  }
771  measurement2 = std::make_unique<FitMeasurement>(*perigee);
772  } else if (s.type(TrackStateOnSurface::Parameter)) {
773  continue;
774  } else {
775  // TSOS type not understood.
776  m_messageHelper->printWarning(16, s.dumpType());
777  continue;
778  }
779  } else if (s.materialEffectsOnTrack()) {
780  surface = &s.materialEffectsOnTrack()->associatedSurface();
781  } else if (s.alignmentEffectsOnTrack()) {
782  surface = &s.alignmentEffectsOnTrack()->associatedSurface();
783  } else {
784  // skip TSOS with missing trackParameters
785  // this should never happen (i.e. where's the surface?)
786  m_messageHelper->printWarning(17, s.dumpType());
787  continue;
788  }
789 
790  // current intersection
791  if (s.trackParameters() && (measurement1 || measurement2)) {
792  Amg::Vector3D direction = s.trackParameters()->momentum().unit();
793  if (startDirection.dot(direction) < 0.) {
794  measurementsFlipped = true;
795  direction = -direction;
796  if (measurement1) {
797  measurement1->flipDriftDirection();
798  }
799  if (measurement2) {
800  measurement2->flipDriftDirection();
801  }
802  }
803  qOverP = s.trackParameters()->parameters()[Trk::qOverP];
804  intersection = TrackSurfaceIntersection(
805  s.trackParameters()->position(), direction, 0.);
806  } else if (surface) {
807  std::optional<TrackSurfaceIntersection> newIntersection =
808  m_stepPropagator->intersectSurface(ctx, *surface, intersection,
810 
811  if (!newIntersection) {
812  m_messageHelper->printWarning(18);
813  measurement2.reset();
814  continue;
815  }
816 
817  intersection = std::move(*newIntersection);
818  if (s.materialEffectsOnTrack()) {
819  const Amg::Vector3D& position = intersection.position();
820  bool calo = (!m_indetVolume->inside(position) &&
821  m_calorimeterVolume->inside(position));
822  measurement1 = std::make_unique<FitMeasurement>(
823  s.materialEffectsOnTrack(),
824  Trk::ParticleMasses::mass[particleHypothesis],
825  intersection.position(), qOverP, calo);
826  if (!calo && !haveMaterial && haveMeasurement) {
827  haveMaterial = true;
828  }
829  } else if (!measurement2) {
830  // TSOS skipped
831  m_messageHelper->printWarning(19, s.dumpType());
832  // delete intersection;
833  continue;
834  }
835  }
836 
837  // check if ordering OK
838  if (!reorder) {
839  double distance =
840  startDirection.dot(intersection.position() - startPosition);
841  Amg::Vector3D positionMst = startPosition;
842  if (s.measurementOnTrack()) {
843  positionMst = s.measurementOnTrack()->globalPosition();
844  }
845  if (s.materialEffectsOnTrack()) {
846  positionMst = s.materialEffectsOnTrack()->associatedSurface().center();
847  }
848  double distanceR = std::sqrt((positionMst.x() - startPosition.x()) *
849  (positionMst.x() - startPosition.x()) +
850  (positionMst.y() - startPosition.y()) *
851  (positionMst.y() - startPosition.y()));
852  double distanceZ = (positionMst.z() - startPosition.z());
853  if (startDirection.z() < 0) {
854  distanceZ = -distanceZ;
855  }
856  if (distance < previousDistance && distanceR < previousDistanceR &&
857  distanceZ < previousDistanceZ) {
858  reorder = true;
859  ATH_MSG_DEBUG(" reorder 3D distance "
860  << distance - previousDistance << " R distance "
861  << distanceR - previousDistanceR << " Z distance "
862  << distanceZ - previousDistanceZ);
863  }
864  previousDistance = distance - m_orderingTolerance;
865  previousDistanceR = distanceR - m_orderingTolerance;
866  previousDistanceZ = distanceZ - m_orderingTolerance;
867  }
868 
869  // insert measurement(s) in list
870  if (measurement1) {
871  if (measurement2) {
872  TrackSurfaceIntersection intersectionCopy = intersection;
873  measurement1->intersection(type, intersectionCopy);
874  measurements.push_back(measurement1.release());
875  } else {
876  measurement1->intersection(type, intersection);
877  measurement1->qOverP(qOverP);
878  measurements.push_back(measurement1.release());
879  }
880  }
881  if (measurement2) {
882  measurement2->intersection(type, intersection);
883  measurement2->qOverP(qOverP);
884  measurements.push_back(measurement2.release());
885  }
886  }
887 
888  // reorder if necessary
889  if (reorder) {
890  m_materialAllocator->orderMeasurements(measurements, startDirection,
891  startPosition);
892  }
893  if (measurementsFlipped) {
894  ATH_MSG_VERBOSE("flipped track measurement order");
895  }
896 
897  // flag whether material has already been allocated
898  return haveMaterial;
899 }
900 
901 std::unique_ptr<Trk::Track> iPatFitter::performFit(
902  FitState& fitState, const ParticleHypothesis particleHypothesis,

◆ addMeasurements() [2/2]

void Trk::iPatFitter::addMeasurements ( const EventContext &  ctx,
std::vector< FitMeasurement * > &  measurements,
const MeasurementSet measurementSet,
const FitParameters parameters 
) const
privateinherited

Definition at line 520 of file iPatFitter.cxx.

520  {
521  // extrapolation to set FittedTrajectory
522  double qOverP = parameters.qOverP();
523  double previousDistance = -m_orderingTolerance;
524  double previousDistanceR = previousDistance;
525  double previousDistanceZ = previousDistance;
526  bool reorder = false;
527 
528  Amg::Vector3D startDirection = parameters.direction();
529  Amg::Vector3D startPosition = parameters.position();
531  TrackSurfaceIntersection intersection = parameters.intersection();
532 
533  TrackSurfaceIntersection startIntersection = intersection ;
534  int hit = measurements.size();
535  for (MeasurementSet::const_iterator m = measurementSet.begin();
536  m != measurementSet.end(); ++m, ++hit) {
537  std::optional<TrackSurfaceIntersection> newIntersection{
538  m_stepPropagator->intersectSurface(ctx, (**m).associatedSurface(),
539  startIntersection, qOverP,
541  if (newIntersection) {
542  intersection = std::move(*newIntersection);
543 
544  // check if ordering OK
545  if (!reorder) {
546  double distance =
547  startDirection.dot(intersection.position() - startPosition);
548  Amg::Vector3D positionMst = (**m).globalPosition();
549  double distanceR = std::sqrt((positionMst.x() - startPosition.x()) *
550  (positionMst.x() - startPosition.x()) +
551  (positionMst.y() - startPosition.y()) *
552  (positionMst.y() - startPosition.y()));
553  double distanceZ = (positionMst.z() - startPosition.z());
554  if (startDirection.z() < 0) {
555  distanceZ = -distanceZ;
556  }
557  if (distance < previousDistance && distanceR < previousDistanceR &&
558  distanceZ < previousDistanceZ) {
559  reorder = true;
560  ATH_MSG_DEBUG(" reorder 3D distance "
561  << distance - previousDistance << " R distance "
562  << distanceR - previousDistanceR << " Z distance "
563  << distanceZ - previousDistanceZ);
564  }
565  previousDistance = distance - m_orderingTolerance;
566  previousDistanceR = distanceR - m_orderingTolerance;
567  previousDistanceZ = distanceZ - m_orderingTolerance;
568  }
569  } else {
570  // FIXME
571  // no intersection to MeasurementSet
572  m_messageHelper->printWarning(15);
573  continue;
574  }
575  auto measurement = std::make_unique<FitMeasurement>(hit, nullptr, *m);
576  measurement->intersection(type, intersection);
577  measurement->qOverP(qOverP);
578  measurements.push_back(measurement.release());
579  // remember the last intersection for the next loop iteration
580  startIntersection = (measurements.back()->intersection(type));
581  }
582 
583  // reorder if necessary
584  if (reorder) {
585  m_materialAllocator->orderMeasurements(measurements, startDirection,
586  startPosition);
587  }
588 }
589 
591  const EventContext& ctx, std::vector<FitMeasurement*>& measurements,

◆ alignmentFit()

Track * Trk::iPatGlobalFitter::alignmentFit ( AlignmentCache ,
const Track ,
const RunOutlierRemoval  runOutlier = false,
const ParticleHypothesis  matEffects = Trk::nonInteracting 
) const
virtual

RE-FIT A TRACK FOR ALIGNMENT.

Since it is not our but the fitter model's decision if to re-fit on PRD or ROT level, it is made pure virtual.

Implements Trk::IGlobalTrackFitter.

Definition at line 32 of file iPatGlobalFitter.cxx.

35  {
36  // @TODO ensure the number of iterations is passed through to the fitter
37  // setMinIterations (alignCache.m_minIterations);
38  if (alignCache.m_derivMatrix != nullptr) {
39  delete alignCache.m_derivMatrix;
40  }
41  alignCache.m_derivMatrix = nullptr;
42 
43  if (alignCache.m_fullCovarianceMatrix != nullptr) {
44  delete alignCache.m_fullCovarianceMatrix;
45  }
46  alignCache.m_fullCovarianceMatrix = nullptr;
47  alignCache.m_iterationsOfLastFit = 0;
48 
49  auto [refittedTrack, fitState] =
50  fitWithState(Gaudi::Hive::currentContext(), trk, runOutlier, matEffects);
51 
52  if (refittedTrack) {
53  alignCache.m_derivMatrix = derivMatrix(*fitState).release();
54  alignCache.m_fullCovarianceMatrix =
55  fullCovarianceMatrix(*fitState).release();
56  alignCache.m_iterationsOfLastFit = iterationsOfLastFit(*fitState);
57  }
58  return refittedTrack.release();
59 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< 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 > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

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

◆ derivMatrix()

std::unique_ptr< Amg::MatrixX > Trk::iPatGlobalFitter::derivMatrix ( const FitState fitState) const
private

GlobalTrackFitter methods: access to the matrix of derivatives used during the latest track fit.

Definition at line 61 of file iPatGlobalFitter.cxx.

62  {
63  // copy derivatives to a new HepMatrix
64  if (!fitState.hasMeasurements() || !fitState.parameters) {
65  return nullptr;
66  }
67 
68  int numberParameters = 5;
69  if (m_allParameters) {
70  numberParameters = fitState.parameters->numberParameters();
71  }
72  int rows = 0;
73 
74  for (const FitMeasurement* m : fitState.getMeasurements()) {
75  if (!m->isPositionMeasurement()) {
76  continue;
77  }
78  rows += m->numberDoF();
79  }
80 
81  if (!numberParameters || !rows) {
82  return nullptr;
83  }
84 
85  ATH_MSG_VERBOSE(" DerivMatrix : " << fitState.getMeasurements().size()
86  << " measurement objects giving " << rows
87  << " rows and " << numberParameters
88  << " columns (parameters)");
89 
90  auto derivativeMatrix =
91  std::make_unique<Amg::MatrixX>(rows, numberParameters);
92  int row = 0;
93  for (const FitMeasurement* m : fitState.getMeasurements()) {
94  if (!m->numberDoF() || !m->isPositionMeasurement()) {
95  continue;
96  }
97  double norm = 0.;
98  if (m->weight() > 0.) {
99  norm = 1. / m->weight();
100  }
101 
102  for (int col = 0; col < numberParameters; ++col) {
103  (*derivativeMatrix)(row, col) = norm * m->derivative(col);
104  }
105 
106  // take care of units for momentum derivs
107  (*derivativeMatrix)(row, 4) *= Gaudi::Units::TeV;
108  if (fitState.parameters->fitEnergyDeposit()) {
109  (*derivativeMatrix)(row, 5) *= Gaudi::Units::TeV;
110  }
111  ++row;
112  if (m->numberDoF() < 2) {
113  continue;
114  }
115 
116  // pixel measurements
117  norm = 0.;
118  if (m->weight2() > 0.)
119  norm = 1. / m->weight2();
120  for (int col = 0; col < numberParameters; ++col) {
121  (*derivativeMatrix)(row, col) = norm * m->derivative2(col);
122  }
123  (*derivativeMatrix)(row, 4) *= Gaudi::Units::TeV;
124  if (fitState.parameters->fitEnergyDeposit()) {
125  (*derivativeMatrix)(row, 5) *= Gaudi::Units::TeV;
126  }
127  ++row;
128  }
129 
130  if (row != rows) {
131  ATH_MSG_WARNING("iPatGlobalFitter: inconsistent #rows in deriv matrix ");
132  }
133 
134  return derivativeMatrix;
135 }

◆ 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

◆ finalize()

StatusCode Trk::iPatFitter::finalize ( )
overridevirtualinherited

Definition at line 135 of file iPatFitter.cxx.

139  {
140  goodFit = static_cast<double>(100 * m_countGoodFits) / fits;
141  if (m_countGoodFits) {
142  iterations = static_cast<double>(m_countIterations) /
143  static_cast<double>(m_countGoodFits);
144  }
145  ATH_MSG_INFO(std::setiosflags(std::ios::fixed)
146  << "finalized after " << m_countFitAttempts
147  << " track-fits attempted, out of which " << std::setw(5)
148  << std::setprecision(1) << goodFit
149  << "% converged, taking an average " << std::setw(5)
150  << std::setprecision(2) << iterations << " iterations");
151  }
153  double refits = static_cast<double>(m_countRefitAttempts);
154  double goodRefit = 0.;
155  double refitIterations = 0.;
156  if (m_countRefitAttempts) {
157  goodRefit = static_cast<double>(100 * m_countGoodRefits) / refits;
158  }
159  if (m_countGoodRefits) {
160  refitIterations = static_cast<double>(m_countRefitIterations) /
161  static_cast<double>(m_countGoodRefits);
162  }
163  ATH_MSG_INFO(std::setiosflags(std::ios::fixed)
164  << "finalized after " << m_countRefitAttempts
165  << " refits attempted, out of which " << std::setw(5)
166  << std::setprecision(1) << goodRefit
167  << "% converged, taking an average " << std::setw(5)
168  << std::setprecision(2) << refitIterations << " iterations");
169  }
170 
171  m_messageHelper->printSummary();
172 
173  return StatusCode::SUCCESS;
174 }
175 
176 auto iPatFitter::fitWithState(const EventContext& ctx, const Track& track,
177  const RunOutlierRemoval runOutlier,

◆ fit() [1/6]

std::unique_ptr< Trk::Track > Trk::iPatFitter::fit ( const EventContext &  ctx,
const MeasurementSet measSet,
const TrackParameters params,
const RunOutlierRemoval  runOutlier = false,
const ParticleHypothesis  matEffects = Trk::nonInteracting 
) const
overridevirtualinherited

FIT A TRACK TO A SET OF MEASUREMENTBASE.

Main fit method. The TrackParameters is a first estimate for the track, represented close to the origin.

Implements Trk::ITrackFitter.

Definition at line 346 of file iPatFitter.cxx.

347  {
348  ATH_MSG_VERBOSE(" fit from measurement set + perigeeStartValue ");
350  // outlier removal not implemented
351  if (runOutlier) {
352  m_messageHelper->printWarning(9);
353  }
354 
355  const Perigee* perigee = dynamic_cast<const Perigee*>(&perigeeStartValue);
356  if (!perigee) {
357  // track without Perigee start value
358  m_messageHelper->printWarning(10);
359  return nullptr;
360  }
361 
362  FitState fitState;
363  fitState.parameters = std::make_unique<FitParameters>(*perigee);
364 
365  // set up the measurements (and material)
366  fitState.newMeasurements();
367  addMeasurements(ctx, fitState.getMeasurements(), measurementSet,
368  *fitState.parameters);
369  Garbage_t garbage;
370  if (particleHypothesis != Trk::nonInteracting) {
371  m_materialAllocator->allocateMaterial(
372  fitState.getMeasurements(), particleHypothesis, *fitState.parameters,
373  perigeeStartValue, garbage);
374  }
375 
376  // perform fit and return fitted track
377  TrackInfo trackInfo(TrackInfo::iPatTrackFitter, particleHypothesis);
378  return performFit(fitState, particleHypothesis, trackInfo, nullptr, nullptr,
379  garbage);
380 }
381 
382 std::unique_ptr<Track> iPatFitter::fit(
383  const EventContext& ctx, const Track& indetTrack,

◆ fit() [2/6]

std::unique_ptr< Track > Trk::iPatFitter::fit ( const EventContext &  ctx,
const PrepRawDataSet prepRawSet,
const TrackParameters params,
const RunOutlierRemoval  runOutlier = false,
const ParticleHypothesis  matEffects = Trk::nonInteracting 
) const
overridevirtualinherited

FIT A TRACK TO A SET OF PrepRawData.

Main fit method. The TrackParameters is a first estimate for the track, represented close to the origin. Use-cases can be thought of that make it necessary to control toggling outlier removal and material effects not via job options (once-per-job) but at each call (toggle within event, large set of fast fit followed by one final full fit).

Implements Trk::ITrackFitter.

Definition at line 283 of file iPatFitter.cxx.

284  {
286  // PrepRawDataSet interface not implemented
287  m_messageHelper->printWarning(4);
288  return nullptr;
289 }
290 
291 std::unique_ptr<Track> iPatFitter::fit(
292  const EventContext& ctx, const Track& track,

◆ fit() [3/6]

std::unique_ptr< Track > Trk::iPatFitter::fit ( const EventContext &  ctx,
const Track track,
const MeasurementSet measSet,
const RunOutlierRemoval  runOutlier = false,
const ParticleHypothesis  matEffects = Trk::nonInteracting 
) const
overridevirtualinherited

RE-FIT A TRACK, ADDING A FITTABLE MEASUREMENT SET.

this method will use the vector of measurements from the existing track and refit adding the new measurements. The code is in this class, but can be overwritten by inheriting classes.

Implements Trk::ITrackFitter.

Definition at line 294 of file iPatFitter.cxx.

294  {
295  ATH_MSG_VERBOSE(" track + measurementSet fit ");
297  // outlier removal not implemented
298  if (runOutlier) {
299  m_messageHelper->printWarning(5);
300  }
301 
302  // create starting parameters
303  if (!track.trackStateOnSurfaces()) {
304  // track without trackStateOnSurfaces
305  m_messageHelper->printWarning(6);
306  return nullptr;
307  }
308  const Perigee* perigee = dynamic_cast<const Perigee*>(
309  (**track.trackStateOnSurfaces()->begin()).trackParameters());
310  if (!perigee) {
311  // track without measuredPerigee
312  m_messageHelper->printWarning(7);
313  return nullptr;
314  }
315 
316  FitState fitState;
317  fitState.parameters = std::make_unique<FitParameters>(*perigee);
318 
319  // set up the measurements (and material)
320  fitState.newMeasurements();
321  if (addMeasurements(ctx, fitState.getMeasurements(), *fitState.parameters,
322  particleHypothesis, *track.trackStateOnSurfaces()))
323  m_messageHelper->printWarning(8); // FIX needed: material may
324  // get double counted
325  addMeasurements(ctx, fitState.getMeasurements(), measurementSet,
326  *fitState.parameters);
327  Garbage_t garbage;
328  if (particleHypothesis != Trk::nonInteracting) {
329  const TrackParameters& endParams =
330  *(track.trackStateOnSurfaces()->back()->trackParameters());
331  m_materialAllocator->allocateMaterial(
332  fitState.getMeasurements(), particleHypothesis, *fitState.parameters,
333  endParams, garbage);
334  }
335 
336  // perform fit and return fitted track
337  TrackInfo trackInfo(TrackInfo::iPatTrackFitter, particleHypothesis);
338  trackInfo.addPatternReco(track.info());
339  return performFit(fitState, particleHypothesis, trackInfo,
340  track.trackStateOnSurfaces(), track.fitQuality(), garbage);
341 }
342 
343 std::unique_ptr<Trk::Track> iPatFitter::fit(
344  const EventContext& ctx, const MeasurementSet& measurementSet,

◆ fit() [4/6]

std::unique_ptr< Track > Trk::iPatFitter::fit ( const EventContext &  ctx,
const Track track,
const PrepRawDataSet prepRawSet,
const RunOutlierRemoval  runOutlier = false,
const ParticleHypothesis  matEffects = Trk::nonInteracting 
) const
overridevirtualinherited

RE-FIT A TRACK, ADDING A PRD SET.

this method will disintegrate the track back to PRD and call the fit(PRDset) method.

Implements Trk::ITrackFitter.

Definition at line 272 of file iPatFitter.cxx.

273  {
275  // track + PrepRawDataSet interface not implemented
276  m_messageHelper->printWarning(3);
277  return nullptr;
278 }
279 
280 std::unique_ptr<Track> iPatFitter::fit(
281  const EventContext&, const PrepRawDataSet& /*prepRawDataSet*/,

◆ fit() [5/6]

std::unique_ptr< Track > Trk::iPatFitter::fit ( const EventContext &  ctx,
const Track track,
const RunOutlierRemoval  runOutlier = false,
const ParticleHypothesis  matEffects = Trk::nonInteracting 
) const
overridevirtualinherited

RE-FIT A TRACK.

Implements Trk::ITrackFitter.

Definition at line 262 of file iPatFitter.cxx.

262  {
263  auto [fittedTrack, fitState] =
264  fitWithState(ctx, track, runOutlier, particleHypothesis);
265  // cppcheck-suppress returnStdMoveLocal; clang requires the move() here.
266  return std::move(fittedTrack);
267 }
268 
269 std::unique_ptr<Track> iPatFitter::fit(
270  const EventContext&, const Track& /*track*/,

◆ fit() [6/6]

std::unique_ptr< Track > Trk::iPatFitter::fit ( const EventContext &  ctx,
const Track track1,
const Track track2,
const RunOutlierRemoval  runOutlier = false,
const ParticleHypothesis  matEffects = Trk::nonInteracting 
) const
overridevirtualinherited

COMBINE TWO TRACKS BY REFITTING.

Specifically designed for combined muon fits, allowing to extract extra informations (ID-exit & MS-entrance parameters, layers, Mefos) from already fitted tracks.

Implements Trk::ITrackFitter.

Definition at line 385 of file iPatFitter.cxx.

385  {
386  ATH_MSG_VERBOSE(" combined muon fit ");
388  // outlier removal not implemented
389  if (runOutlier) {
390  m_messageHelper->printWarning(11);
391  }
392 
393  // indet (full refit to measurements or use measured perigee)
394  bool haveMaterial = true;
395  FitState fitState;
396  fitState.newMeasurements();
397  if (indetTrack.perigeeParameters()) {
398  fitState.parameters =
399  std::make_unique<FitParameters>(*indetTrack.perigeeParameters());
400  } else if (spectrometerTrack.perigeeParameters() &&
401  m_indetVolume->inside(spectrometerTrack.perigeeParameters()
402  ->associatedSurface()
403  .center())) {
404  fitState.parameters =
405  std::make_unique<FitParameters>(*spectrometerTrack.perigeeParameters());
406  } else {
407  // combined muon fit without Perigee start value"
408  m_messageHelper->printWarning(12);
409  return nullptr;
410  }
411 
412  // get both perigee parameters, use most precise for momentum starting value
413  const Perigee* indetPerigee =
414  dynamic_cast<const Perigee*>(indetTrack.perigeeParameters());
415  const Perigee* spectrometerPerigee =
416  dynamic_cast<const Perigee*>(spectrometerTrack.perigeeParameters());
417  if (spectrometerPerigee &&
418  !m_indetVolume->inside(
419  spectrometerPerigee->associatedSurface().center())) {
420  spectrometerPerigee = nullptr;
421  }
422  if (!spectrometerTrack.info().trackProperties(
424  spectrometerPerigee) {
425  if (indetTrack.info().trackProperties(Trk::TrackInfo::StraightTrack) ||
426  !indetPerigee || !indetPerigee->covariance()) {
427  fitState.parameters->qOverP(
428  spectrometerPerigee->parameters()[Trk::qOverP]);
429  ATH_MSG_VERBOSE(" set starting momentum from spectrometer "
430  << 1. /
431  (fitState.parameters->qOverP() * Gaudi::Units::GeV)
432  << " GeV");
433  } else if (indetPerigee) {
434  if (spectrometerPerigee->covariance() &&
435  (*spectrometerPerigee->covariance())(Trk::qOverP, Trk::qOverP) <
436  (*indetPerigee->covariance())(Trk::qOverP, Trk::qOverP)) {
437  fitState.parameters->qOverP(
438  spectrometerPerigee->parameters()[Trk::qOverP]);
440  " set starting momentum from spectrometer "
441  << 1. / (fitState.parameters->qOverP() * Gaudi::Units::GeV)
442  << " GeV");
443  }
444  }
445  }
446 
447  if (m_fullCombinedFit) {
448  // set up the measurements
449  if (!indetTrack.trackStateOnSurfaces()) {
450  // fail as indet track without trackStateOnSurfaces
451  m_messageHelper->printWarning(13);
452  return nullptr;
453  }
454  if (!addMeasurements(ctx, fitState.getMeasurements(), *fitState.parameters,
455  particleHypothesis,
456  *indetTrack.trackStateOnSurfaces())) {
457  haveMaterial = false;
458  }
459  }
460 
461  // add the spectrometer measurements
462  if (!addMeasurements(ctx, fitState.getMeasurements(), *fitState.parameters,
463  particleHypothesis,
464  *spectrometerTrack.trackStateOnSurfaces())) {
465  haveMaterial = false;
466  }
467  Garbage_t garbage;
468  if (!haveMaterial && particleHypothesis != Trk::nonInteracting) {
469  Perigee* startingPerigee = fitState.parameters->startingPerigee();
470  if (startingPerigee) {
471  m_materialAllocator->allocateMaterial(
472  fitState.getMeasurements(), particleHypothesis, *fitState.parameters,
473  *startingPerigee, garbage);
474  delete startingPerigee;
475  }
476  }
477 
478  // create starting parameters, perform fit and return fitted track
479  TrackInfo trackInfo(TrackInfo::iPatTrackFitter, particleHypothesis);
480  trackInfo.addPatternReco(indetTrack.info());
481  trackInfo.addPatternReco(spectrometerTrack.info());
482  if (m_fullCombinedFit) {
483  std::unique_ptr<Trk::Track> fittedTrack = performFit(
484  fitState, particleHypothesis, trackInfo, nullptr, nullptr, garbage);
485 
486  // validation
487  for (int i = 0; i < m_forcedRefitsForValidation; ++i) {
488  if (fittedTrack) {
489  refit(ctx, fitState, *fittedTrack, runOutlier, particleHypothesis);
490  }
491  }
492 
493  return fittedTrack;
494  } // hybrid fit
495  if (!indetPerigee) {
496  // fail combined muon fit as indet track without measuredPerigee
497  m_messageHelper->printWarning(14);
498  return nullptr;
499  }
500  fitState.getMeasurements().insert(fitState.getMeasurements().begin(),
501  new FitMeasurement(*indetPerigee));
502  FitParameters measuredParameters(*indetPerigee);
503  std::unique_ptr<Trk::Track> fittedTrack = performFit(
504  fitState, particleHypothesis, trackInfo,
505  indetTrack.trackStateOnSurfaces(), indetTrack.fitQuality(), garbage);
506 
507  // validation
508  for (int i = 0; i < m_forcedRefitsForValidation; ++i) {
509  if (fittedTrack) {
510  refit(ctx, fitState, *fittedTrack, runOutlier, particleHypothesis);
511  }
512  }
513 
514  return fittedTrack;
515 }
516 
517 void iPatFitter::addMeasurements(const EventContext& ctx,
518  std::vector<FitMeasurement*>& measurements,

◆ fitWithState()

auto Trk::iPatFitter::fitWithState ( const EventContext &  ctx,
const Track track,
const RunOutlierRemoval  runOutlier = false,
const ParticleHypothesis  particleHypothesis = Trk::nonInteracting 
) const
protectedinherited

Definition at line 179 of file iPatFitter.cxx.

179  {
180  ATH_MSG_VERBOSE(" track fit ");
181  auto fitState = std::make_unique<FitState>();
182 
184  // outlier removal not implemented
185  if (runOutlier) {
186  m_messageHelper->printWarning(0);
187  } // TODO Make thread-safe
188 
189  // create Perigee if starting parameters are for a different surface type
190  const Perigee* perigeeParameters = track.perigeeParameters();
191  // Note: we don't own the Perigee from perigeeParameters(), but if it returns
192  // nullptr, we have to make our own, and we need to delete it, so it's put in
193  // this unique_ptr
194  std::unique_ptr<Perigee> newPerigee;
195  std::unique_ptr<PerigeeSurface> perigeeSurface;
196 
197  if (!perigeeParameters) {
198  auto i = track.trackStateOnSurfaces()->begin();
199  while (i != track.trackStateOnSurfaces()->end() &&
200  !(**i).trackParameters()) {
201  i++;
202  }
203  const TrackStateOnSurface& s = (**i);
204  if (!s.trackParameters()) {
205  // input track without parameters
206  m_messageHelper->printWarning(1);
207  return {nullptr, std::move(fitState)};
208  }
209 
210  Amg::Vector3D origin(s.trackParameters()->position());
211  perigeeSurface = std::make_unique<PerigeeSurface>(origin);
212  newPerigee = std::make_unique<Perigee>(
213  s.trackParameters()->position(), s.trackParameters()->momentum(),
214  s.trackParameters()->charge(), *perigeeSurface);
215  }
216 
217  const Perigee& perigee =
218  newPerigee ? *newPerigee : *perigeeParameters; // Use the valid Perigee
219 
220  fitState->parameters = std::make_unique<FitParameters>(perigee);
221 
222  // set up the measurements
223  if (!track.trackStateOnSurfaces()) {
224  // input track without trackStateOnSurfaces
225  m_messageHelper->printWarning(2); // TODO Make thread-safe
226  return {nullptr, std::move(fitState)};
227  }
228 
229  fitState->newMeasurements();
230 
231  bool haveMaterial =
232  addMeasurements(ctx, fitState->getMeasurements(), *fitState->parameters,
233  particleHypothesis, *track.trackStateOnSurfaces());
234 
235  // allocate material
236  Garbage_t garbage;
237  if (!haveMaterial && particleHypothesis != Trk::nonInteracting) {
238  m_materialAllocator->allocateMaterial(
239  fitState->getMeasurements(), particleHypothesis, *fitState->parameters,
240  perigee, garbage);
241  }
242 
243  // perform fit and return fitted track
244  TrackInfo trackInfo(TrackInfo::iPatTrackFitter, particleHypothesis);
245  trackInfo.addPatternReco(track.info());
246  std::unique_ptr<Trk::Track> fittedTrack{performFit(
247  *fitState, particleHypothesis, trackInfo, nullptr, nullptr, garbage)};
248 
249  // validation
250  for (int i = 0; i < m_forcedRefitsForValidation; ++i) {
251  if (fittedTrack) {
252  refit(ctx, *fitState, *fittedTrack, runOutlier, particleHypothesis);
253  }
254  }
255 
256  return {std::move(fittedTrack), std::move(fitState)};
257 }
258 
259 std::unique_ptr<Track> iPatFitter::fit(
260  const EventContext& ctx, const Track& track,

◆ fullCovarianceMatrix()

std::unique_ptr< Amg::MatrixX > Trk::iPatGlobalFitter::fullCovarianceMatrix ( const FitState fitState) const
private

access to the global fitter's full covariance matrix

Definition at line 137 of file iPatGlobalFitter.cxx.

138  {
139  int numberParameters = 5;
140 
141  if (m_allParameters) {
142  numberParameters = fitState.parameters->numberParameters();
143  }
144  ATH_MSG_VERBOSE(" FullCovarianceMatrix for " << numberParameters
145  << " parameters");
146 
147  return std::make_unique<Amg::MatrixX>(m_fitProcedure->fullCovariance()->block(
148  0, 0, numberParameters, numberParameters));
149 }

◆ initialize()

StatusCode Trk::iPatFitter::initialize ( )
overridevirtualinherited

Definition at line 49 of file iPatFitter.cxx.

50  : outlier removal not implemented");
51  m_messageHelper->setMessage(1, "fit (Track): track without perigee");
52  m_messageHelper->setMessage(
53  2, "fit (Track): track without trackStateOnSurfaces");
54  m_messageHelper->setMessage(
55  3, "fit (Track + PrepRawDataSet): interface not implemented");
56  m_messageHelper->setMessage(
57  4, "fit (PrepRawDataSet): interface not implemented");
58  m_messageHelper->setMessage(
59  5, "fit (Track + MeasurementSet): outlier removal not implemented");
60  m_messageHelper->setMessage(
61  6, "fit (Track + MeasurementSet): track without trackStateOnSurfaces");
62  m_messageHelper->setMessage(
63  7, "fit (Track + MeasurementSet): track without measuredPerigee");
64  m_messageHelper->setMessage(
65  8, "fit (Track + MeasurementSet): FIX material may get double counted");
66  m_messageHelper->setMessage(
67  9, "fit (Perigee + MeasurementSet): outlier removal not implemented");
68  m_messageHelper->setMessage(10,
69  "fit (Perigee + MeasurementSet): null perigee");
70  m_messageHelper->setMessage(
71  11, "fit (combined muon): outlier removal not implemented");
72  m_messageHelper->setMessage(12,
73  "fit (combined muon): no perigee start value");
74  m_messageHelper->setMessage(
75  13, "fit (combined muon): indet track without trackStateOnSurfaces");
76  m_messageHelper->setMessage(
77  14, "fit (combined muon): indet track without measuredPerigee");
78  m_messageHelper->setMessage(
80  m_messageHelper->setMessage(
81  16, "addMeasurements: skip TSOS as not understood. Type: ");
82  m_messageHelper->setMessage(
83  17, "addMeasurements: skip TSOS with missing trackParameters. Type: ");
84  m_messageHelper->setMessage(
85  18,
86  "addMeasurements: skip measurement as fail to intersect associated "
87  "surface from given starting parameters");
88  m_messageHelper->setMessage(19, "addMeasurements: TSOS skipped. Type: ");
89  m_messageHelper->setMessage(20,
90  "fail fit as CaloDeposit outside calo volume");
91  m_messageHelper->setMessage(
92  21, "conflicting energy deposit sign for inDet material");
93  m_messageHelper->setMessage(
94  22, "conflicting energy deposit sign for spectrometer material");
95  m_messageHelper->setMessage(23, "excessive calorimeter energy loss : ");
96  m_messageHelper->setMessage(24, "excessive spectrometer energy loss : ");
97  m_messageHelper->setMessage(25, "flipped track measurement order");
98 
99  ATH_CHECK(m_materialAllocator.retrieve());
100  ATH_CHECK(m_rungeKuttaIntersector.retrieve());
101  ATH_CHECK(m_solenoidalIntersector.retrieve());
102  ATH_CHECK(m_stepPropagator.retrieve());
103  ATH_CHECK(m_straightLineIntersector.retrieve());
104 
105  // need to create the IndetExit and MuonEntrance TrackingVolumes
106  if (m_trackingVolumesSvc.retrieve().isFailure()) {
107  ATH_MSG_FATAL("Failed to retrieve Svc " << m_trackingVolumesSvc);
108  return StatusCode::FAILURE;
109  }
110  m_calorimeterVolume =
111  std::make_unique<Trk::Volume>(m_trackingVolumesSvc->volume(
112  ITrackingVolumesSvc::MuonSpectrometerEntryLayer));
113  m_indetVolume = std::make_unique<Volume>(
114  m_trackingVolumesSvc->volume(ITrackingVolumesSvc::CalorimeterEntryLayer));
115 
116  ATH_CHECK(m_trackSummaryTool.retrieve());
117 
118  // can now create FitProcedure class
119  m_fitProcedure = std::make_unique<FitProcedure>(
120  m_constrainedAlignmentEffects, m_extendedDebug, m_lineFit,
121  m_rungeKuttaIntersector, m_solenoidalIntersector,
122  m_straightLineIntersector, m_stepPropagator, m_indetVolume.get(),
123  m_maxIterations,
124  1); // useStepPropagator
125  // useStepPropagator 0 means not used (so Intersector used)
126  // 1 Intersector not used and StepPropagator used with FullField
127  // 2 StepPropagator with FastField propagation
128  // 99 debug mode where both are ran with FullField
129  return StatusCode::SUCCESS;
130 }
131 
132 StatusCode iPatFitter::finalize() {
133  // print summary statistics

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

◆ iterationsOfLastFit()

int Trk::iPatGlobalFitter::iterationsOfLastFit ( const FitState fitState)
staticprivate

access to the number of iterations taken by the latest track fit

Definition at line 151 of file iPatGlobalFitter.cxx.

151  {
152  return fitState.iterations;
153 }

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

◆ performFit()

std::unique_ptr< Trk::Track > Trk::iPatFitter::performFit ( FitState fitState,
const ParticleHypothesis  particleHypothesis,
const TrackInfo trackInfo,
const Trk::TrackStates leadingTSOS,
const FitQuality perigeeQuality,
Garbage_t garbage 
) const
privateinherited

std::scoped_lock lock(m_fitProcedureMutex);

Definition at line 904 of file iPatFitter.cxx.

904  {
905  std::vector<FitMeasurement*>& measurements = fitState.getMeasurements();
906  FitParameters* parameters = fitState.parameters.get();
907  // initialize the scattering centres
908  m_materialAllocator->initializeScattering(measurements);
909 
910  // set fixed momentum in lineFit case according to configuration
911  if (m_lineFit) {
912  parameters->fitMomentum(false);
913  if (m_lineMomentum > 0.) {
914  parameters->qOverP(1. / m_lineMomentum);
915  }
916  }
917 
918  // perform fit
919  MsgStream log(msgSvc(), name());
920  Trk::FitProcedure::Cache cache(m_fitProcedure->constrainedAlignmentEffects());
921 
922  // This lock should no be needed , leaving it for now
923  // until we are sure all function pass thread safety
924  // requirements
926 
927  const FitProcedureQuality& quality =
928  m_fitProcedure->execute(cache, m_asymmetricCaloEnergy, log, measurements,
929  parameters, perigeeQuality);
930  std::unique_ptr<Track> fittedTrack;
931  if (!quality.fitCode()) {
932  // include leading material
933  m_materialAllocator->addLeadingMaterial(measurements, particleHypothesis,
934  *parameters, garbage);
935 
936  // construct the fitted track
937  fittedTrack.reset(m_fitProcedure->constructTrack(
938  cache, measurements, *parameters, trackInfo, leadingTSOS));
939  if (fittedTrack) {
940  // set StraightLine when momentum unfitted
941  if (!parameters->fitMomentum()) {
942  fittedTrack->info().setTrackProperties(TrackInfo::StraightTrack);
943  }
944 
945  // special check for CaloDeposit - parameters must be inside calorimeter
946  for (const Trk::TrackStateOnSurface* tsos :
947  *fittedTrack->trackStateOnSurfaces()) {
948  if (!tsos->type(TrackStateOnSurface::CaloDeposit)) {
949  continue;
950  }
951  if (tsos->trackParameters()) {
952  const Amg::Vector3D position = tsos->trackParameters()->position();
953  if (!m_indetVolume->inside(position) &&
954  m_calorimeterVolume->inside(position)) {
955  break;
956  }
957  }
958  // something badly wrong: WARN and kill track
959  // fail fit as CaloDeposit outside calo volume
961  "fail fit as CaloDeposit outside calo volume: " << (*fittedTrack));
962  fittedTrack.reset();
963  break;
964  }
965  }
966 
967  // statistics for successful fit
968  if (fittedTrack) {
969  ++m_countGoodFits;
970  m_countIterations += quality.iterations();
971  fitState.iterations = quality.iterations();
972 
973  // report material
974  if (msgLvl(MSG::DEBUG)) {
975  int calo = 0;
976  double caloX0 = 0.;
977  double caloEloss = 0.;
978  int indet = 0;
979  double indetX0 = 0.;
980  double indetEloss = 0.;
981  int spect = 0;
982  double spectX0 = 0.;
983  double spectEloss = 0.;
984  for (FitMeasurement* m : measurements) {
985  if (m->isEnergyDeposit()) {
986  calo++;
987  caloEloss += m->energyLoss();
988  } else if (!m->isScatterer()) {
989  continue;
990  }
991 
992  if (m_indetVolume->inside(m->position())) {
993  indet++;
994  indetX0 += m->materialEffects()->thicknessInX0();
995  indetEloss += m->energyLoss();
996  // conflicting energy deposit sign for inDet material
997  if (m->energyLoss() * indetEloss < 0.) {
998  m_messageHelper->printWarning(21);
999  }
1000  continue;
1001  }
1002  if (m_calorimeterVolume->inside(
1003  m->intersection(FittedTrajectory).position())) {
1004  calo++;
1005  caloX0 += m->materialEffects()->thicknessInX0();
1006  continue;
1007  }
1008 
1009  spect++;
1010  spectX0 += m->materialEffects()->thicknessInX0();
1011  spectEloss += m->energyLoss();
1012  // conflicting energy deposit sign for spectrometer material
1013  if (m->energyLoss() * spectEloss < 0.) {
1014  m_messageHelper->printWarning(22);
1015  }
1016  }
1017 
1018  // WARN in case of bug #56297
1019  if (calo) {
1020  // excessive calorimeter energy loss
1021  if (std::abs(caloEloss) > 200. * Gaudi::Units::GeV &&
1022  m_messageHelper->wouldPrintWarning(23)) {
1023  std::stringstream ss;
1024  ss << caloEloss / Gaudi::Units::GeV << " for track with P "
1025  << fittedTrack->perigeeParameters()->momentum().mag() /
1027  << " GeV";
1028  m_messageHelper->printWarning(23, ss.str());
1029  }
1030 
1031  // excessive spectrometer energy loss
1032  if ((std::abs(spectEloss) > (0.5 * Gaudi::Units::GeV)) &&
1033  (std::abs(spectEloss * caloX0) >
1034  std::abs(4. * caloEloss * spectX0)) &&
1035  m_messageHelper->wouldPrintWarning(24)) {
1036  std::stringstream ss;
1037  ss << spectEloss / Gaudi::Units::GeV << " ( "
1038  << caloEloss / Gaudi::Units::GeV
1039  << " calorimeter energy loss). Track has P "
1040  << fittedTrack->perigeeParameters()->momentum().mag() /
1042  << " GeV";
1043  m_messageHelper->printWarning(24, ss.str());
1044  }
1045  }
1046 
1047  msg(MSG::VERBOSE) << std::setiosflags(std::ios::fixed);
1048  if (indet) {
1049  msg() << std::setw(5) << indet << " indet scatterers with"
1050  << " material: X0" << std::setw(6) << std::setprecision(3)
1051  << indetX0;
1052  if (calo && caloEloss < 0.) {
1053  msg() << " energyGain";
1054  } else {
1055  msg() << " energyLoss";
1056  }
1057  msg() << std::setw(6) << std::setprecision(3)
1058  << indetEloss / Gaudi::Units::GeV << ",";
1059  }
1060 
1061  if (spect) {
1062  msg() << std::setw(5) << spect << " spectrometer scatterers with"
1063  << " material: X0" << std::setw(8) << std::setprecision(3)
1064  << spectX0;
1065  if (calo && caloEloss < 0.) {
1066  msg() << " energyGain";
1067  } else {
1068  msg() << " energyLoss";
1069  }
1070  msg() << std::setw(7) << std::setprecision(3)
1071  << spectEloss / Gaudi::Units::GeV;
1072  }
1073 
1074  if (!indet && !spect) {
1075  msg() << " 0 scatterers - no tracking material";
1076  }
1077  msg() << endmsg;
1078  }
1079  }
1080  }
1081 
1082  // generate a track summary for this candidate
1083  if ((m_trackSummaryTool.isEnabled()) && (fittedTrack != nullptr)) {
1084  m_trackSummaryTool->computeAndReplaceTrackSummary(*fittedTrack, false);
1085  }
1086 
1087  return fittedTrack;
1088 }
1089 
1090 void iPatFitter::printTSOS(const Track& track) const {
1091  // debugging aid

◆ printTSOS()

void Trk::iPatFitter::printTSOS ( const Track track) const
privateinherited

Definition at line 1093 of file iPatFitter.cxx.

1099  {
1100  msg() << std::setiosflags(std::ios::fixed | std::ios::right) << " TSOS# "
1101  << std::setw(3) << tsos << " parameters: " << std::setw(7)
1102  << std::setprecision(1) << (**t).trackParameters()->position().perp()
1103  << std::setw(8) << std::setprecision(4)
1104  << (**t).trackParameters()->position().phi() << std::setw(9)
1105  << std::setprecision(1) << (**t).trackParameters()->position().z()
1106  << " position " << std::setw(8) << std::setprecision(4)
1107  << (**t).trackParameters()->momentum().phi() << " phi "
1108  << std::setw(7) << std::setprecision(4)
1109  << (**t).trackParameters()->momentum().theta() << " theta "
1110  << std::setw(9) << std::setprecision(4)
1111  << (**t).trackParameters()->momentum().mag() / Gaudi::Units::GeV
1112  << " GeV";
1113 
1114  if ((**t).measurementOnTrack()) {
1115  msg() << " meas ";
1116  } else {
1117  msg() << " ";
1118  }
1119  if ((**t).materialEffectsOnTrack()) {
1120  msg() << " scat ";
1121  } else {
1122  msg() << " ";
1123  }
1124  msg() << (**t).dumpType() << endmsg;
1125  }
1126 }
1127 
1128 void iPatFitter::refit(const EventContext& ctx, FitState& fitState,
1129  const Track& track, const RunOutlierRemoval runOutlier,

◆ refit()

void Trk::iPatFitter::refit ( const EventContext &  ctx,
FitState fitState,
const Track track,
const RunOutlierRemoval  runOutlier,
const ParticleHypothesis  particleHypothesis 
) const
privateinherited

Definition at line 1131 of file iPatFitter.cxx.

1136  {
1137  m_messageHelper->printWarning(0);
1138  }
1139 
1140  // create Perigee if starting parameters are for a different surface type
1141  const Perigee* perigeeParameters = track.perigeeParameters();
1142  // Note: we don't own the Perigee from perigeeParameters(), but if it returns
1143  // nullptr, we have to make our own, and we need to delete it, so it's put in
1144  // this unique_ptr
1145  std::unique_ptr<Perigee> newPerigee;
1146  std::unique_ptr<PerigeeSurface> perigeeSurface;
1147 
1148  if (!perigeeParameters) {
1149  auto i = track.trackStateOnSurfaces()->begin();
1150  while (i != track.trackStateOnSurfaces()->end() &&
1151  !(**i).trackParameters()) {
1152  i++;
1153  }
1154  const TrackStateOnSurface& s = (**i);
1155  if (!s.trackParameters()) {
1156  // input track without parameters
1157  m_messageHelper->printWarning(1);
1158  m_countGoodRefits += m_countGoodFits - countGoodFits;
1159  m_countGoodFits = countGoodFits;
1160  m_countRefitIterations += m_countIterations - countIterations;
1161  m_countIterations = countIterations;
1162  return;
1163  }
1164 
1165  Amg::Vector3D origin(s.trackParameters()->position());
1166  perigeeSurface = std::make_unique<PerigeeSurface>(origin);
1167  newPerigee = std::make_unique<Perigee>(
1168  s.trackParameters()->position(), s.trackParameters()->momentum(),
1169  s.trackParameters()->charge(), *perigeeSurface);
1170  }
1171 
1172  const Perigee& perigee =
1173  newPerigee ? *newPerigee : *perigeeParameters; // Use the valid Perigee
1174 
1175  fitState.parameters = std::make_unique<FitParameters>(perigee);
1176 
1177  // set up the measurements
1178  if (!track.trackStateOnSurfaces()) {
1179  // input track without trackStateOnSurfaces
1180  m_messageHelper->printWarning(2);
1181  m_countGoodRefits += m_countGoodFits - countGoodFits;
1182  m_countGoodFits = countGoodFits;
1183  m_countRefitIterations += m_countIterations - countIterations;
1184  m_countIterations = countIterations;
1185  return;
1186  }
1187 
1188  fitState.newMeasurements();
1189 
1190  bool haveMaterial =
1191  addMeasurements(ctx, fitState.getMeasurements(), *fitState.parameters,
1192  particleHypothesis, *track.trackStateOnSurfaces());
1193 
1194  // allocate material
1195  Garbage_t garbage;
1196  if (!haveMaterial && particleHypothesis != Trk::nonInteracting) {
1197  m_materialAllocator->allocateMaterial(
1198  fitState.getMeasurements(), particleHypothesis, *fitState.parameters,
1199  perigee, garbage);
1200  }
1201 
1202  // perform fit and return fitted track
1203  TrackInfo trackInfo(TrackInfo::iPatTrackFitter, particleHypothesis);
1204  trackInfo.addPatternReco(track.info());
1205  std::unique_ptr<Trk::Track> fittedTrack{performFit(
1206  fitState, particleHypothesis, trackInfo, nullptr, nullptr, garbage)};
1207 
1208  m_countGoodRefits += m_countGoodFits - countGoodFits;
1209  m_countGoodFits = countGoodFits;
1210  m_countRefitIterations += m_countIterations - countIterations;
1211  m_countIterations = countIterations;
1212 }
1213 } // namespace Trk

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

◆ setMinIterations()

void Trk::iPatGlobalFitter::setMinIterations ( int  minIterations)
private

set method for the minimum number of iterations for (alignment) friend

Definition at line 155 of file iPatGlobalFitter.cxx.

155  {
156  m_fitProcedure->setMinIterations(minIterations);
157 }

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

Gaudi::Property<bool> Trk::iPatFitter::m_aggregateMaterial {this, "AggregateMaterial", true}
privateinherited

Definition at line 183 of file iPatFitter.h.

◆ m_allParameters

bool Trk::iPatGlobalFitter::m_allParameters
private

Definition at line 52 of file iPatGlobalFitter.h.

◆ m_asymmetricCaloEnergy

Gaudi::Property<bool> Trk::iPatFitter::m_asymmetricCaloEnergy
privateinherited
Initial value:
{this, "AsymmetricCaloEnergy",
true}

Definition at line 184 of file iPatFitter.h.

◆ m_calorimeterVolume

std::unique_ptr<Trk::Volume> Trk::iPatFitter::m_calorimeterVolume
privateinherited

Definition at line 225 of file iPatFitter.h.

◆ m_constrainedAlignmentEffects

Gaudi::Property<bool> Trk::iPatFitter::m_constrainedAlignmentEffects
privateinherited
Initial value:
{
this, "ConstrainedAlignmentEffects", false}

Definition at line 217 of file iPatFitter.h.

◆ m_countFitAttempts

std::atomic<unsigned> Trk::iPatFitter::m_countFitAttempts = 0
mutableprivateinherited

Definition at line 230 of file iPatFitter.h.

◆ m_countGoodFits

std::atomic<unsigned> Trk::iPatFitter::m_countGoodFits = 0
mutableprivateinherited

Definition at line 231 of file iPatFitter.h.

◆ m_countGoodRefits

std::atomic<unsigned> Trk::iPatFitter::m_countGoodRefits = 0
mutableprivateinherited

Definition at line 234 of file iPatFitter.h.

◆ m_countIterations

std::atomic<unsigned> Trk::iPatFitter::m_countIterations = 0
mutableprivateinherited

Definition at line 232 of file iPatFitter.h.

◆ m_countRefitAttempts

std::atomic<unsigned> Trk::iPatFitter::m_countRefitAttempts = 0
mutableprivateinherited

Definition at line 233 of file iPatFitter.h.

◆ m_countRefitIterations

std::atomic<unsigned> Trk::iPatFitter::m_countRefitIterations = 0
mutableprivateinherited

Definition at line 235 of file iPatFitter.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_extendedDebug

Gaudi::Property<bool> Trk::iPatFitter::m_extendedDebug {this, "ExtendedDebug", false}
privateinherited

Definition at line 219 of file iPatFitter.h.

◆ m_fitProcedure

std::unique_ptr<FitProcedure> Trk::iPatFitter::m_fitProcedure
protectedinherited

Definition at line 148 of file iPatFitter.h.

◆ m_fitProcedureMutex

std::mutex Trk::iPatFitter::m_fitProcedureMutex
mutableprotectedinherited

Definition at line 149 of file iPatFitter.h.

◆ m_forcedRefitsForValidation

Gaudi::Property<int> Trk::iPatFitter::m_forcedRefitsForValidation
privateinherited
Initial value:
{
this, "ForcedRefitsForValidation", 0}

Definition at line 220 of file iPatFitter.h.

◆ m_fullCombinedFit

Gaudi::Property<bool> Trk::iPatFitter::m_fullCombinedFit {this, "FullCombinedFit", true}
privateinherited

Definition at line 186 of file iPatFitter.h.

◆ m_globalFit

const bool Trk::iPatFitter::m_globalFit = false
protectedinherited

Definition at line 152 of file iPatFitter.h.

◆ m_indetVolume

std::unique_ptr<Trk::Volume> Trk::iPatFitter::m_indetVolume
privateinherited

Definition at line 226 of file iPatFitter.h.

◆ m_lineFit

Gaudi::Property<bool> Trk::iPatFitter::m_lineFit {this, "LineFit", false}
privateinherited

Definition at line 187 of file iPatFitter.h.

◆ m_lineMomentum

Gaudi::Property<double> Trk::iPatFitter::m_lineMomentum
privateinherited
Initial value:
{this, "LineMomentum",

Definition at line 188 of file iPatFitter.h.

◆ m_materialAllocator

ToolHandle<IMaterialAllocator> Trk::iPatFitter::m_materialAllocator
privateinherited
Initial value:
{
this, "MaterialAllocator", "Trk::MaterialAllocator/MaterialAllocator"}

Definition at line 191 of file iPatFitter.h.

◆ m_maxIterations

Gaudi::Property<int> Trk::iPatFitter::m_maxIterations {this, "MaxIterations", 25}
privateinherited

Definition at line 222 of file iPatFitter.h.

◆ m_maxWarnings

Gaudi::Property<unsigned> Trk::iPatFitter::m_maxWarnings
privateinherited
Initial value:
{
this, "MaxNumberOfWarnings", 10,
"Maximum number of permitted WARNING messages per message type."}

Definition at line 212 of file iPatFitter.h.

◆ m_messageHelper

std::unique_ptr<MessageHelper> Trk::iPatFitter::m_messageHelper
privateinherited

Definition at line 238 of file iPatFitter.h.

◆ m_orderingTolerance

Gaudi::Property<double> Trk::iPatFitter::m_orderingTolerance
privateinherited
Initial value:
{this, "OrderingTolerance",

Definition at line 210 of file iPatFitter.h.

◆ m_rungeKuttaIntersector

ToolHandle<IIntersector> Trk::iPatFitter::m_rungeKuttaIntersector
privateinherited
Initial value:
{
this, "RungeKuttaIntersector",
"Trk::RungeKuttaIntersector/RungeKuttaIntersector"}

Definition at line 193 of file iPatFitter.h.

◆ m_solenoidalIntersector

ToolHandle<IIntersector> Trk::iPatFitter::m_solenoidalIntersector
privateinherited
Initial value:
{
this, "SolenoidalIntersector",
"Trk::SolenoidalIntersector/SolenoidalIntersector"}

Definition at line 196 of file iPatFitter.h.

◆ m_stepField

Trk::MagneticFieldProperties Trk::iPatFitter::m_stepField
privateinherited

Definition at line 227 of file iPatFitter.h.

◆ m_stepPropagator

ToolHandle<IPropagator> Trk::iPatFitter::m_stepPropagator
privateinherited
Initial value:
{
this, "Propagator", "Trk::STEP_Propagator/AtlasSTEP_Propagator"}

Definition at line 199 of file iPatFitter.h.

◆ m_straightLineIntersector

ToolHandle<IIntersector> Trk::iPatFitter::m_straightLineIntersector
privateinherited
Initial value:
{
this, "StraightLineIntersector",
"Trk::StraightLineIntersector/StraightLineIntersector"}

Definition at line 201 of file iPatFitter.h.

◆ m_trackingVolumesSvc

ServiceHandle<ITrackingVolumesSvc> Trk::iPatFitter::m_trackingVolumesSvc
privateinherited
Initial value:
{
this, "TrackingVolumesSvc", "TrackingVolumesSvc/TrackingVolumesSvc"}

Definition at line 204 of file iPatFitter.h.

◆ m_trackSummaryTool

ToolHandle<Trk::IExtendedTrackSummaryTool> Trk::iPatFitter::m_trackSummaryTool
privateinherited
Initial value:
{
this, "TrackSummaryTool", "MuonTrackSummaryTool"}

Definition at line 206 of file iPatFitter.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:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
query_example.row
row
Definition: query_example.py:24
beamspotman.r
def r
Definition: beamspotman.py:676
Trk::TrackStateOnSurface::CaloDeposit
@ CaloDeposit
This TSOS contains a CaloEnergy object.
Definition: TrackStateOnSurface.h:135
Trk::TrackStateOnSurface::Perigee
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
Definition: TrackStateOnSurface.h:117
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
Trk::iPatFitter::performFit
std::unique_ptr< Track > performFit(FitState &fitState, const ParticleHypothesis particleHypothesis, const TrackInfo &trackInfo, const Trk::TrackStates *leadingTSOS, const FitQuality *perigeeQuality, Garbage_t &garbage) const
Definition: iPatFitter.cxx:904
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Trk::PrepRawDataSet
std::vector< const PrepRawData * > PrepRawDataSet
vector of clusters and drift circles
Definition: FitterTypes.h:26
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Amg::hasPositiveDiagElems
bool hasPositiveDiagElems(const AmgSymMatrix(N) &mat)
Returns true if all diagonal elements of the covariance matrix are finite aka sane in the above defin...
Definition: EventPrimitivesCovarianceHelpers.h:96
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Trk::iPatFitter::m_materialAllocator
ToolHandle< IMaterialAllocator > m_materialAllocator
Definition: iPatFitter.h:191
perigeeParameters
Definition: ExtrapolatorComparisonTest.h:42
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
Trk::iPatFitter::m_forcedRefitsForValidation
Gaudi::Property< int > m_forcedRefitsForValidation
Definition: iPatFitter.h:220
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trk::iPatFitter::m_messageHelper
std::unique_ptr< MessageHelper > m_messageHelper
Definition: iPatFitter.h:238
Trk::TrackInfo::iPatTrackFitter
@ iPatTrackFitter
tracks produced by iPat
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:44
Trk::iPatFitter::m_stepPropagator
ToolHandle< IPropagator > m_stepPropagator
Definition: iPatFitter.h:199
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::iPatFitter::iPatFitter
iPatFitter(const std::string &type, const std::string &name, const IInterface *parent, bool isGlobalFit=false)
Definition: iPatFitter.cxx:40
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
Trk::iPatFitter::m_countRefitIterations
std::atomic< unsigned > m_countRefitIterations
Definition: iPatFitter.h:235
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:7
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
Trk::iPatFitter::m_lineFit
Gaudi::Property< bool > m_lineFit
Definition: iPatFitter.h:187
Trk::Perigee
ParametersT< 5, Charged, PerigeeSurface > Perigee
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:29
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trk::iPatGlobalFitter::derivMatrix
std::unique_ptr< Amg::MatrixX > derivMatrix(const FitState &fitState) const
GlobalTrackFitter methods: access to the matrix of derivatives used during the latest track fit.
Definition: iPatGlobalFitter.cxx:61
python.atlas_oh.im
im
Definition: atlas_oh.py:167
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
athena.value
value
Definition: athena.py:122
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
python.SystemOfUnits.TeV
int TeV
Definition: SystemOfUnits.py:158
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Trk::iPatFitter::fit
virtual std::unique_ptr< Track > fit(const EventContext &ctx, const Track &, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis particleHypothesis=Trk::nonInteracting) const override
RE-FIT A TRACK.
Definition: iPatFitter.cxx:262
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Muon::CompetingMuonClustersOnTrack
Definition: CompetingMuonClustersOnTrack.h:54
Trk::iPatFitter::m_countRefitAttempts
std::atomic< unsigned > m_countRefitAttempts
Definition: iPatFitter.h:233
Trk::TrackParameters
ParametersBase< 5, Charged > TrackParameters
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:24
intersection
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
Definition: compareFlatTrees.cxx:25
Trk::FitProcedure::Cache
Definition: FitProcedure.h:47
Trk::iPatFitter::m_countGoodRefits
std::atomic< unsigned > m_countGoodRefits
Definition: iPatFitter.h:234
Trk::RunOutlierRemoval
bool RunOutlierRemoval
switch to toggle quality processing after fit
Definition: FitterTypes.h:22
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
Trk::TrackInfo::StraightTrack
@ StraightTrack
A straight track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:84
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
Trk::iPatFitter::m_orderingTolerance
Gaudi::Property< double > m_orderingTolerance
Definition: iPatFitter.h:210
Trk::iPatFitter::addMeasurements
void addMeasurements(const EventContext &ctx, std::vector< FitMeasurement * > &measurements, const MeasurementSet &measurementSet, const FitParameters &parameters) const
Definition: iPatFitter.cxx:520
Trk::iPatFitter::m_lineMomentum
Gaudi::Property< double > m_lineMomentum
Definition: iPatFitter.h:188
Trk::iPatFitter::m_countFitAttempts
std::atomic< unsigned > m_countFitAttempts
Definition: iPatFitter.h:230
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
Trk::TrackStateOnSurface::Hole
@ Hole
A hole on the track - this is defined in the following way.
Definition: TrackStateOnSurface.h:128
lumiFormat.i
int i
Definition: lumiFormat.py:92
Trk::iPatFitter::m_extendedDebug
Gaudi::Property< bool > m_extendedDebug
Definition: iPatFitter.h:219
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
mc.order
order
Configure Herwig7.
Definition: mc.Herwig7_Dijet.py:12
Trk::iPatFitter::refit
void refit(const EventContext &ctx, FitState &fitState, const Track &track, const RunOutlierRemoval runOutlier, const ParticleHypothesis particleHypothesis) const
Definition: iPatFitter.cxx:1131
test_pyathena.parent
parent
Definition: test_pyathena.py:15
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:127
Trk::iPatFitter::m_fitProcedure
std::unique_ptr< FitProcedure > m_fitProcedure
Definition: iPatFitter.h:148
beamspotnt.rows
list rows
Definition: bin/beamspotnt.py:1112
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
Trk::iPatFitter::m_calorimeterVolume
std::unique_ptr< Trk::Volume > m_calorimeterVolume
Definition: iPatFitter.h:225
Trk::muon
@ muon
Definition: ParticleHypothesis.h:28
xAODType
Definition: ObjectType.h:13
Trk::TrackStateOnSurface::Parameter
@ Parameter
This TSOS contains a Trk::ParameterBase.
Definition: TrackStateOnSurface.h:140
trackInfo
Definition: TrigInDetUtils.h:13
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
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::iPatFitter::m_stepField
Trk::MagneticFieldProperties m_stepField
Definition: iPatFitter.h:227
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk::iPatFitter::m_countIterations
std::atomic< unsigned > m_countIterations
Definition: iPatFitter.h:232
Trk::ParticleMasses::mass
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:53
Trk::ExtrapolationType
ExtrapolationType
Definition: ExtrapolationType.h:18
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Trk::iPatFitter::m_asymmetricCaloEnergy
Gaudi::Property< bool > m_asymmetricCaloEnergy
Definition: iPatFitter.h:184
Trk::perigeeParameters
@ perigeeParameters
Definition: MeasurementType.h:19
Trk::nonInteracting
@ nonInteracting
Definition: ParticleHypothesis.h:25
Trk::FittedTrajectory
@ FittedTrajectory
Definition: ExtrapolationType.h:19
Trk::iPatFitter::Garbage_t
IMaterialAllocator::Garbage_t Garbage_t
Definition: iPatFitter.h:39
Trk::iPatGlobalFitter::iterationsOfLastFit
static int iterationsOfLastFit(const FitState &fitState)
access to the number of iterations taken by the latest track fit
Definition: iPatGlobalFitter.cxx:151
Muon::CompetingMuonClustersOnTrack::containedROTs
const std::vector< const MuonClusterOnTrack * > & containedROTs() const
returns the vector of SCT_ClusterOnTrack objects .
Definition: CompetingMuonClustersOnTrack.h:184
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
query_example.col
col
Definition: query_example.py:7
CxxUtils::to
CONT to(RANGE &&r)
Definition: ranges.h:32
Trk::iPatFitter::fitWithState
std::pair< std::unique_ptr< Track >, std::unique_ptr< FitState > > fitWithState(const EventContext &ctx, const Track &, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis particleHypothesis=Trk::nonInteracting) const
Definition: iPatFitter.cxx:179
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
Trk::iPatFitter::m_fullCombinedFit
Gaudi::Property< bool > m_fullCombinedFit
Definition: iPatFitter.h:186
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
a
TList * a
Definition: liststreamerinfos.cxx:10
h
Amg::intersect
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the closest approach of two lines.
Definition: GeoPrimitivesHelpers.h:302
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::iPatGlobalFitter::fullCovarianceMatrix
std::unique_ptr< Amg::MatrixX > fullCovarianceMatrix(const FitState &fitState) const
access to the global fitter's full covariance matrix
Definition: iPatGlobalFitter.cxx:137
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
Trk::iPatGlobalFitter::m_allParameters
bool m_allParameters
Definition: iPatGlobalFitter.h:52
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:73
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Trk::RIO_OnTrack::identify
virtual Identifier identify() const final
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:155
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
Trk::iPatFitter::printTSOS
void printTSOS(const Track &) const
Definition: iPatFitter.cxx:1093
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Trk::iPatFitter::m_trackSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
Definition: iPatFitter.h:206
Trk::outside
@ outside
Definition: PropDirection.h:29
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
skip
bool skip
Definition: TrigGlobEffCorrValidation.cxx:190
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::iPatFitter::m_countGoodFits
std::atomic< unsigned > m_countGoodFits
Definition: iPatFitter.h:231
ReadFromCoolCompare.no
no
Definition: ReadFromCoolCompare.py:232
fitman.k
k
Definition: fitman.py:528
beamspotman.fail
def fail(message)
Definition: beamspotman.py:201
Trk::iPatFitter::m_indetVolume
std::unique_ptr< Trk::Volume > m_indetVolume
Definition: iPatFitter.h:226