|
ATLAS Offline Software
|
Go to the documentation of this file.
16 declareInterface<IResidualPullCalculator>(
this);
25 return StatusCode::SUCCESS;
35 std::array<double,5> residuals{};
40 if (muonCompClusters) rot = muonCompClusters->
containedROTs().empty() ? nullptr :
43 if (!trkPar || !rot) {
44 if( !trkPar )
ATH_MSG_WARNING (
"No TrackParameters, cannot calculate residual/pull ");
50 if( m_idHelperSvc->isTgc(
ID) ) {
52 double sinAlpha = 0.0;
54 bool isStrip = m_idHelperSvc->tgcIdHelper().isStrip(
ID);
61 <<
"LocalParameters structure!");
72 double cosAlpha = std::sqrt(1 - sinAlpha*sinAlpha);
82 <<
"LocalParameters structure!" );
108 if (muonCompClusters) rot = muonCompClusters->
containedROTs().empty() ? nullptr :
111 if (!trkPar || !rot) {
112 if( !trkPar )
ATH_MSG_WARNING (
"No TrackParameters, cannot calculate residual/pull ");
113 if( !rot )
ATH_MSG_WARNING (
"No ROT, cannot calculate residual/pull ");
118 if( m_idHelperSvc->isTgc(
ID) ) {
122 bool pullIsValid = (trkCov);
124 double sinAlpha = 0.0;
126 bool isStrip = m_idHelperSvc->tgcIdHelper().isStrip(
ID);
130 std::vector<double>
pull(1);
135 <<
"LocalParameters structure!");
149 ATH_MSG_WARNING (
"Could not obtain TGC detEl from TGC ROT, this is a bug!" );
153 double cosAlpha = std::sqrt(1 - sinAlpha*sinAlpha);
162 RotMat(0,0) = cosAlpha;
163 RotMat(0,1) = sinAlpha;
164 RotMat(1,0) = -sinAlpha;
165 RotMat(1,1) = cosAlpha;
174 Amg::MatrixX transformedTrkCov = subm.similarity(RotMat);
177 transformedROTCov(0,0),
178 transformedTrkCov(0,0),
182 transformedROTCov(0,0),
190 <<
"LocalParameters structure!" );
212 return std::make_optional<Trk::ResidualPull>(std::move(
residual), std::move(
pull), pullIsValid, resType, 1, sinAlpha);
225 const double locMesCov,
226 const double locTrkCov,
228 if( locMesCov < 0 ) {
229 ATH_MSG_DEBUG(
"Bad error " << locMesCov <<
" " << locTrkCov <<
" using measured error ");
234 if( locMesCov + locTrkCov > 0 ) ErrorSum = std::sqrt(locMesCov + locTrkCov);
236 ATH_MSG_DEBUG(
"Bad error measurement " << locMesCov <<
" from track " << locTrkCov <<
", using measured error ");
237 ErrorSum = std::sqrt(locMesCov);
240 if ((locMesCov - locTrkCov) < 0.) {
243 ErrorSum = std::sqrt(locMesCov - locTrkCov);
244 }
else ErrorSum = std::sqrt(locMesCov);
245 if (ErrorSum != 0)
return residual/ErrorSum;
TGC_ResidualPullCalculator(const std::string &, const std::string &, const IInterface *)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
std::vector< Identifier > ID
int parameterKey() const
Identifier key for matrix expansion/reduction.
@ Unbiased
RP with track state that has measurement not included.
#define ATH_MSG_VERBOSE(x)
#define AmgSymMatrix(dim)
::StatusCode StatusCode
StatusCode definition for legacy code.
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
MeasurementType
enum describing the flavour of MeasurementBase
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
virtual std::optional< Trk::ResidualPull > residualPull(const Trk::MeasurementBase *measurement, const Trk::TrackParameters *trkPar, const Trk::ResidualPull::ResidualType, const Trk::TrackState::MeasurementType) const override
This function returns (creates!) a Trk::ResidualPull object, which contains the values of residual an...
const std::vector< const MuonClusterOnTrack * > & containedROTs() const
returns the vector of SCT_ClusterOnTrack objects .
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
@ Biased
RP with track state including the hit.
double calcPull(const double residual, const double locMesCov, const double locTrkCov, const Trk::ResidualPull::ResidualType &) const
internal structuring: common code for calculating hit pulls
#define ATH_MSG_WARNING(x)
Identifier identify() const
return the identifier -extends MeasurementBase
virtual const TrkDetElementBase * detectorElement() const =0
returns the detector element, assoicated with the PRD of this class
virtual std::array< double, 5 > residuals(const Trk::MeasurementBase *measurement, const Trk::TrackParameters *trkPar, const Trk::ResidualPull::ResidualType, const Trk::TrackState::MeasurementType) const override
This function is a light-weight version of the function above, designed for track fitters where speed...
virtual StatusCode initialize() override