ATLAS Offline Software
AlignResidualCalculator.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRKALIGNGENTOOLS_ALIGNRESIDUALCALCULATOR_H
6 #define TRKALIGNGENTOOLS_ALIGNRESIDUALCALCULATOR_H
7 
9 #include "GaudiKernel/ToolHandle.h"
11 
13 
25 class AtlasDetectorID;
26 
27 namespace Trk {
28 
29  class AlignTrack;
30  class IUpdator;
31  class IResidualPullCalculator;
32  class ResidualPull;
33  class Track;
34  class AlignTSOS;
35  class TrackStateOnSurface;
36 
38 
39  public:
40 
41  AlignResidualCalculator(const std::string& type, const std::string& name,
42  const IInterface* parent);
43  virtual ~AlignResidualCalculator();
44 
45  virtual StatusCode initialize() override;
46  virtual StatusCode finalize() override;
47 
49  virtual double setResiduals(DataVector<AlignTSOS>* alignTSOSColl,
50  const Track* track) override;
51 
53  virtual double setResiduals(AlignTrack* alignTrack,
54  const Track* track) override;
55 
57  virtual double setResiduals(DataVector<AlignTSOS>::iterator firstAtsos,
59  const Track* track, bool newTrack) override;
60 
62  virtual double chi2ForMeasType(int measType) const override
63  { return m_chi2ForMeasType[measType]; }
64 
65  private:
66 
67  double setResidualsOnATSOS(AlignTSOS* atsos, const TrackStateOnSurface* tsos);
68  void accumulateScattering(const TrackStateOnSurface* tsos);
69  const TrackStateOnSurface* getMatchingTSOS(const AlignTSOS* atsos, const Track* track);
70 
71  ToolHandle <IResidualPullCalculator> m_pullCalculator;
72  ToolHandle <IUpdator> m_updator;
73 
74  int m_resType; //<! residual type as defined in the Trk::AlignResidualType enum
75 
77  double m_qOverP;
79 
80  int m_nDoF;
81 
83 
84  std::vector<const TrackStateOnSurface*> m_matchedTSOS;
85 
86  };
87 
88 
89 }
90 
91 #endif // TRKALIGNGENTOOLS_ALIGNRESIDUALCALCULATOR_H
Trk::AlignResidualCalculator::accumulateScattering
void accumulateScattering(const TrackStateOnSurface *tsos)
Definition: AlignResidualCalculator.cxx:309
Trk::AlignResidualCalculator::m_matchedTSOS
std::vector< const TrackStateOnSurface * > m_matchedTSOS
Definition: AlignResidualCalculator.h:84
IAlignResidualCalculator.h
Trk::AlignTSOS
Definition: AlignTSOS.h:37
Trk::AlignResidualCalculator::m_resType
int m_resType
Definition: AlignResidualCalculator.h:74
Trk::AlignResidualCalculator::finalize
virtual StatusCode finalize() override
Definition: AlignResidualCalculator.cxx:77
Trk::AlignResidualCalculator::m_chi2ForMeasType
double * m_chi2ForMeasType
Definition: AlignResidualCalculator.h:82
Trk::AlignResidualCalculator::m_includeScatterers
bool m_includeScatterers
Definition: AlignResidualCalculator.h:76
Trk::AlignResidualCalculator::m_qOverP
double m_qOverP
Definition: AlignResidualCalculator.h:77
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
AlignTSOS
AlignTSOS is a TSOS with extra variables useful for alignment. It is created using an implementation ...
Trk::IAlignResidualCalculator
Definition: IAlignResidualCalculator.h:35
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trk::AlignResidualCalculator::initialize
virtual StatusCode initialize() override
Definition: AlignResidualCalculator.cxx:53
Trk::AlignResidualCalculator::~AlignResidualCalculator
virtual ~AlignResidualCalculator()
Definition: AlignResidualCalculator.cxx:47
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
Trk::AlignResidualCalculator::setResidualsOnATSOS
double setResidualsOnATSOS(AlignTSOS *atsos, const TrackStateOnSurface *tsos)
Definition: AlignResidualCalculator.cxx:151
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
Trk::AlignResidualCalculator::m_nDoF
int m_nDoF
Definition: AlignResidualCalculator.h:80
Trk::AlignResidualCalculator
Definition: AlignResidualCalculator.h:37
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::AlignResidualCalculator::m_pullCalculator
ToolHandle< IResidualPullCalculator > m_pullCalculator
Definition: AlignResidualCalculator.h:71
Trk::AlignTrack
Definition: AlignTrack.h:41
Trk::AlignResidualCalculator::setResiduals
virtual double setResiduals(DataVector< AlignTSOS > *alignTSOSColl, const Track *track) override
sets residuals for AlignTSOS on AlignTrack and returns total chi2
Trk::AlignResidualCalculator::m_updator
ToolHandle< IUpdator > m_updator
Definition: AlignResidualCalculator.h:72
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
Trk::AlignResidualCalculator::setResiduals
virtual double setResiduals(DataVector< AlignTSOS >::iterator firstAtsos, DataVector< AlignTSOS >::iterator lastAtsos, const Track *track, bool newTrack) override
sets residuals for AlignTSOS on AlignTrack and returns total chi2
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Trk::AlignResidualCalculator::m_previousQOverP
double m_previousQOverP
Definition: AlignResidualCalculator.h:78
Trk::AlignResidualCalculator::AlignResidualCalculator
AlignResidualCalculator(const std::string &type, const std::string &name, const IInterface *parent)
Definition: AlignResidualCalculator.cxx:26
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Trk::AlignResidualCalculator::chi2ForMeasType
virtual double chi2ForMeasType(int measType) const override
returns chi2 summed over hits of a particular MeasurementType
Definition: AlignResidualCalculator.h:62
AthAlgTool
Definition: AthAlgTool.h:26
Trk::AlignResidualCalculator::getMatchingTSOS
const TrackStateOnSurface * getMatchingTSOS(const AlignTSOS *atsos, const Track *track)
Definition: AlignResidualCalculator.cxx:329
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
AlignTrack
AlignTrack is a generalization of a Trk::Track, used as the basic object to contain track information...