|
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include "GaudiKernel/PhysicalConstants.h"
11 #include "GeoModelKernel/throwExcept.h"
23 namespace SegmentFitHelpers{
24 using namespace SegmentFit;
33 switch (measurement.
type()) {
43 if (
msg.level() <= MSG::WARNING) {
44 msg<<MSG::WARNING<<__FILE__<<
":"<<__LINE__<<
" - Unsupported measurement: "
60 if (
msg.level() <= printLvl) {
79 std::optional<double> travelledDist = Amg::intersect<3>(segPos, segDir, normal, normal.dot(stripSP.
positionInChamber()));
80 const Amg::Vector3D planeCrossing = segPos + travelledDist.value_or(0) * segDir;
84 if (
msg.level() <= printLvl) {
89 <<
", covariance: " <<std::endl<<
Amg::toString(stripSP.covariance())<<
", inverse: "
98 const double timeOffset, std::optional<double> arrivalTime,
102 switch (hit.
type()) {
115 if (
msg.level() <= MSG::WARNING) {
116 msg<<MSG::WARNING<<__FILE__<<
":"<<__LINE__<<
" - Unsupported measurement: "
133 const Amg::Vector3D closePointSeg = segPos + Amg::intersect<3>(hitPos, hitDir, segPos, segDir).value_or(0)* segDir;
135 const Amg::Vector3D closePointWire = hitPos + hitDir.dot(closePointSeg - hitPos) * hitDir;
140 if (
msg.level() <= printLvl) {
147 (Amg::lineDistance<3>(hitPos, hitDir, segPos, segDir) -hit.
driftRadius())<<std::endl <<
", covariance: "<<std::endl
157 const double offsetTime,
158 std::optional<double> arrivalTime,
165 const SpacePoint* spacePoint = strip.spacePoint();
167 std::optional<double> travelledDist = Amg::intersect<3>(segPos, segDir, normal, normal.dot(spacePoint->
positionInChamber()));
168 const Amg::Vector3D planeCrossing = segPos + travelledDist.value_or(0) * segDir;
170 if (strip.measuresTime() && arrivalTime) {
171 residual[
Amg::z] = strip.time() - (*arrivalTime) - travelledDist.value_or(0) * c_inv - offsetTime;
176 if (
msg.level() <= printLvl) {
181 <<
", covariance: "<<std::endl<<
toString(strip.covariance())<<
", inverse: "
195 const Amg::Vector3D planeCrossing{segPos + Amg::intersect<3>(segPos, segDir, Amg::Vector3D::UnitZ(),
200 if (
msg.level() <= printLvl) {
212 const std::vector<const SpacePoint*>& uncalibHits,
215 std::vector<int> signs{};
216 signs.reserve(uncalibHits.size());
218 signs.push_back( sp ?
driftSign(segPos,segDir, *sp,
msg) : 0);
223 const std::vector<std::unique_ptr<CalibratedSpacePoint>>& calibHits,
225 std::vector<int> signs{};
226 signs.reserve(calibHits.size());
227 for (
const std::unique_ptr<CalibratedSpacePoint>& hit : calibHits) {
238 if (
msg.level() <= printLvl) {
240 <<
", signed distance: "<<signedDist<<
", unsigned distance: "
243 return sign(signedDist);
251 if (
msg.level() <= printLvl) {
254 <<
", signed distance: "<<signedDist<<
", unsigned distance: "
257 return sign(signedDist);
std::vector< int > driftSigns(const Amg::Vector3D &posInChamber, const Amg::Vector3D &dirInChamber, const std::vector< const SpacePoint * > &uncalibHits, MsgStream &msg)
Calculates whether a segment line travereses the tube measurements on the left (-1) or right (1) side...
const MuonGMR4::SpectrometerSector * msSector() const
xAOD::UncalibMeasType type() const
Eigen::Matrix< double, 2, 1 > Vector2D
Amg::Vector3D planeNormal() const
Returns the vector pointing out of the measurement plane.
double chiSqTerm(const Amg::Vector3D &posInChamber, const Amg::Vector3D &dirInChamber, const SpacePoint &measurement, MsgStream &msg)
Calculates the chi2 contribuation to a linear segment line from an uncalibrated measurement.
std::string toString(const CalibratedSpacePoint::Covariance_t &mat)
Returns the matrix in string.
const xAOD::UncalibratedMeasurement * primaryMeasurement() const
int driftSign(const Amg::Vector3D &posInChamber, const Amg::Vector3D &dirInChamber, const SpacePoint &uncalibHit, MsgStream &msg)
Calculates whether a segement line travereses the tube measurement on the left (-1) or right (1) side...
double chiSqTermStrip(const Amg::Vector3D &posInChamber, const Amg::Vector3D &dirInChamber, const SpacePoint &measurement, MsgStream &msg)
Calculates the chi2 contribuation to a linear segment line from an uncalibrated strip measurement.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
double chiSqTermMdt(const Amg::Vector3D &posInChamber, const Amg::Vector3D &dirInChamber, const SpacePoint &measurement, MsgStream &msg)
Calculates the chi2 contribuation to a linear segment line from an uncalibrated Mdt measurement.
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
double chi2(TH1 *h0, TH1 *h1)
State
State flag to distinguish different space point states.
xAOD::UncalibMeasType type() const
Returns the space point type.
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
const Amg::Vector3D & directionInChamber() const
constexpr double sign(const double x)
Returns the sign of a number.
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns the IdHelpeSvc.
State fitState() const
Returns the state of the calibrated space point.
const Amg::Vector3D & positionInChamber() const
The position of the calibrated space point inside the chamber.
Eigen::Matrix< double, 3, 1 > Vector3D
This header ties the generic definitions in this package.
const Amg::Vector3D & positionInChamber() const
virtual std::string toString(const Identifier &id) const =0
print all fields to string
The calibrated Space point is created during the calibration process.
unsigned int dimension() const
Is the space point a 1D or combined 2D measurement.
double signedDistance(const Amg::Vector3D &posA, const Amg::Vector3D &dirA, const Amg::Vector3D &posB, const Amg::Vector3D &dirB)
Calculates the signed distance between two lines in 3D space.
double driftRadius() const
: Returns the size of the drift radius
const Covariance_t & covariance() const
https://gitlab.cern.ch/atlas/athena/-/blob/master/MuonSpectrometer/MuonReconstruction/MuonRecEvent/Mu...
const SpacePoint * spacePoint() const
The pointer to the space point out of which this space point has been built.
const Amg::Vector3D & directionInChamber() const
The direction of the calibrated space point inside the chamber.
double driftRadius() const
The drift radius of the calibrated space point.
Scalar mag() const
mag method
const Identifier & identify() const
: Identifier of the primary measurement
double chiSqTermBeamspot(const Amg::Vector3D &posInChamber, const Amg::Vector3D &dirInChamber, const CalibratedSpacePoint &beamSpotMeas, MsgStream &msg)
Calculates the chi2 contribution from an external beam spot constraint.
double contract(const CalibratedSpacePoint::Covariance_t &mat, const Amg::Vector3D &a, const Amg::Vector3D &b)