|
ATLAS Offline Software
|
Go to the documentation of this file.
30 , m_pullCalculator(
"Trk::ResidualPullCalculator/ResidualPullCalculator")
31 , m_updator(
"Trk::KalmanUpdator/TrkKalmanUpdator")
35 , m_chi2ForMeasType(
nullptr)
37 declareInterface<IAlignResidualCalculator>(
this);
39 declareProperty(
"ResidualPullCalculator", m_pullCalculator);
40 declareProperty(
"ResidualType", m_resType =
HitOnly);
41 declareProperty(
"IncludeScatterers", m_includeScatterers =
false );
43 declareProperty(
"UpdatorTool", m_updator);
58 return StatusCode::FAILURE;
66 return StatusCode::FAILURE;
73 return StatusCode::SUCCESS;
79 return StatusCode::SUCCESS;
85 bool useNewTrack = (
track!=
nullptr);
92 bool useNewTrack = (
track!=
nullptr);
93 const Track* newTrack = (useNewTrack) ?
track : alignTrack;
120 const TrackStateOnSurface* tsos =
125 const MaterialEffectsBase* meb = tsos->materialEffectsOnTrack();
141 int imeasType=(**atsos).measType();
170 ATH_MSG_WARNING(
"When using unbiased residuals including scatterers doesn't make sense!");
178 nscatparam = (scatterer) ? 2 : 1;
180 for (
int iparam=0;iparam<nscatparam;iparam++) {
210 dchi2 +=
res.residualNorm()*
res.residualNorm();
213 else if (!atsos->
rio() && !atsos->
crio()) {
221 double residual = .001*(E0-E1-energyLoss);
224 ATH_MSG_DEBUG(
"E0/E1/energyLoss: "<<E0<<
"/"<<E1<<
"/"<<energyLoss);
231 dchi2 +=
res.residualNorm()*
res.residualNorm();
238 if (atsos->
rio() || atsos->
crio()) {
241 for (
int iparam=0;iparam<nparams;iparam++) {
247 (atsos->
rio()!=
nullptr || atsos->
crio()!=
nullptr) ) {
252 std::optional<ResidualPull> resPull = std::nullopt;
262 if (unbiasedTrackPars) {
263 trackPars = unbiasedTrackPars;
268 ATH_MSG_WARNING(
"Could not get unbiased track parameters, use normal parameters");
271 ATH_MSG_DEBUG(
"Calling ResidualPullCalculator for residual type "
280 residual = (resPull->residual())[iparam];
281 double pull=(resPull->pull())[iparam];
301 dchi2 +=
res.residualNorm()*
res.residualNorm();
321 if (!
dynamic_cast<const CaloEnergy*
>(energyLoss)) {
333 if (atsos->
rio() || atsos->
crio()) {
365 if (!itTsos->trackParameters()) {
ATH_MSG_WARNING(
"no track parameters!");
continue; }
366 const Amg::Vector3D newPosition=itTsos->trackParameters()->position();
367 ATH_MSG_DEBUG(
"origPos: "<<origPosition<<
", newPos: "<<newPosition);
368 double newdist2=(newPosition - origPosition).
mag2();
376 if (!tsos)
return nullptr;
383 ATH_MSG_WARNING(
"TSOS already found with position "<<addPosition<<
"!");
void clearResiduals()
clears vector of residuals
double deltaPhi() const
returns the
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
void setUnbiasedTrackPars(const TrackParameters *trkPars)
setter for unbiased track parameters
TrackState::MeasurementType measType() const
returns measurement type enum
const RIO_OnTrack * rio() const
returns RIO_OnTrack or leading RIO of CompetingRIOsOnTrack (assigned by c'tor)
class extending the basic Trk::EnergyLoss to describe the measured or parameterised muon energy loss ...
std::string find(const std::string &s)
return a remapped string
double charge() const
Returns the charge.
DataModel_detail::iterator< DataVector > iterator
Standard iterator.
void accumulateScattering(const TrackStateOnSurface *tsos)
std::vector< const TrackStateOnSurface * > m_matchedTSOS
const Amg::Vector3D & position() const
Access method for the position.
double sigmaDeltaE() const
returns the symmatric error
std::string dumpType() const
returns a string with the expanded type of the object (i.e.
represents a deflection of the track caused through multiple scattering in material.
const MeasurementBase * measurementOnTrack() const
returns MeasurementBase const overload
ResidualPull::ResidualType ResidualPullType(AlignResidualType type)
base class to integrate material effects on Trk::Track in a flexible way.
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
virtual StatusCode finalize() override
represents the full description of deflection and e-loss of a track in material.
double * m_chi2ForMeasType
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
double sigmaDeltaTheta() const
returns the
AlignTSOSCollection::const_iterator firstAtsos() const
retrieve iterator pointer to first element in collection
(Non-const) Iterator class for DataVector/DataList.
const MaterialEffectsBase * materialEffectsOnTrack() const
return material effects const overload
AlignTSOS is a TSOS with extra variables useful for alignment. It is created using an implementation ...
::StatusCode StatusCode
StatusCode definition for legacy code.
std::pair< std::vector< unsigned int >, bool > res
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
double chi2(TH1 *h0, TH1 *h1)
double deltaE() const
returns the
virtual StatusCode initialize() override
virtual ~AlignResidualCalculator()
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
double setResidualsOnATSOS(AlignTSOS *atsos, const TrackStateOnSurface *tsos)
Ensure that the ATLAS eigen extensions are properly loaded.
double pT() const
Access method for transverse momentum.
represents the track state (measurement, material, fit parameters and quality) at a surface.
This class describes energy loss material effects in the ATLAS tracking EDM.
virtual const Amg::Vector3D & globalPosition() const =0
Interface method to get the global Position.
ToolHandle< IResidualPullCalculator > m_pullCalculator
Eigen::Matrix< double, 3, 1 > Vector3D
virtual double setResiduals(DataVector< AlignTSOS > *alignTSOSColl, const Track *track) override
sets residuals for AlignTSOS on AlignTrack and returns total chi2
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
ToolHandle< IUpdator > m_updator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const EnergyLoss * energyLoss() const
returns the energy loss object.
#define ATH_MSG_WARNING(x)
const CompetingRIOsOnTrack * crio() const
returns CompetingRIOsOnTrack
Identifier identify() const
return the identifier -extends MeasurementBase
AlignResidualCalculator(const std::string &type, const std::string &name, const IInterface *parent)
const ScatteringAngles * scatteringAngles() const
returns the MCS-angles object.
void addResidual(const Residual &residual)
pushes back vector of Residuals to alignTSOS residuals
double sigmaDeltaPhi() const
returns the
double deltaTheta() const
returns the
float distance2(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the squared distance between two point in 3D space
Scalar mag2() const
mag2 method - forward to squaredNorm()
const TrackStateOnSurface * getMatchingTSOS(const AlignTSOS *atsos, const Track *track)
@ NumberOfMeasurementTypes
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
AlignTSOSCollection::const_iterator lastAtsos() const
returns iterator pointer to last element in collection