18 inline double calcChi2 (
const Trk::Track& trk) {
20 if (!fq || !fq->
numberDoF()) {
return FLT_MAX;}
28 declareInterface<IMuonSegmentFittingTool>(
this);
37 return StatusCode::SUCCESS;
45 const std::vector<const Trk::MeasurementBase*>& rioVec)
const {
47 const EventContext& ctx = Gaudi::Hive::currentContext();
50 double gdirNorm = gdir.mag();
51 bool isCurvedSegment = (gdirNorm > 1.5);
52 if (isCurvedSegment) {
54 gdir =
Amg::Vector3D(gdir.x() / gdirNorm, gdir.y() / gdirNorm, gdir.z() / gdirNorm);
62 std::unique_ptr<Trk::TrackParameters> exPars =
70 double sign = exPars->position().dot(exPars->momentum()) > 0 ? 1. : -1.;
74 double phi = gdir.phi();
75 double theta = gdir.theta();
81 std::vector<const Trk::MeasurementBase*> vec2;
82 vec2.reserve(rioVec.size());
83 std::copy(rioVec.begin(), rioVec.end(), std::back_inserter(vec2));
86 std::unique_ptr<Trk::Track> newtrack;
88 if (isCurvedSegment) {
100 constexpr double chi2Cut = 10.;
101 std::unique_ptr<Trk::Track> cleanTrack =
m_trackCleaner->clean(*newtrack, ctx);
102 if (!cleanTrack && !isCurvedSegment && calcChi2(*newtrack) > chi2Cut) {
107 if (cleanTrack && !(*cleanTrack->perigeeParameters() == *newtrack->perigeeParameters()) && !isCurvedSegment) {
109 newtrack.swap(cleanTrack);
113 if (calcChi2(*newtrack) > chi2Cut) {
114 ATH_MSG_VERBOSE(
" reduced chi2 to large " << calcChi2(*newtrack) <<
" cut " << chi2Cut);
128 return newtrack.release();
136 const EventContext& ctx = Gaudi::Hive::currentContext();
143 std::unique_ptr<Trk::TrackParameters> exPars =
151 surf.
globalToLocal(exPars->position(), exPars->position(), lpos);
161 if (exPars->covariance()) locerr = *exPars->covariance();
Scalar phi() const
phi method
Scalar theta() const
theta method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
double charge(const T &p)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool msgLvl(const MSG::Level lvl) const
This is the common class for 3D segments used in the muon spectrometer.
const Amg::Vector3D & globalDirection() const
global direction
virtual const Amg::Vector3D & globalPosition() const override final
global position
virtual const Trk::PlaneSurface & associatedSurface() const override final
returns the surface for the local to global transformation
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
double chiSquared() const
returns the of the overall track fit
represents the three-dimensional global direction with respect to a planar surface frame.
double angleXZ() const
access method for angle of local XZ projection
double angleYZ() const
access method for angle of local YZ projection
This class is the pure abstract base class for all fittable tracking measurements.
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
double charge() const
Returns the charge.
Class describing the Line to which the Perigee refers to.
Class for a planaer rectangular or trapezoidal surface in the ATLAS detector.
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const override final
Specified for PlaneSurface: GlobalToLocal method without dynamic memory allocation - boolean checks i...
void globalToLocalDirection(const Amg::Vector3D &glodir, Trk::LocalDirection &locdir) const
This method transforms the global direction to a local direction wrt the plane.
const std::vector< const Trk::MeasurementBase * > & containedMeasurements() const
returns the vector of Trk::MeasurementBase objects
const FitQuality * fitQuality() const
return a pointer to the fit quality const-overload
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Ensure that the ATLAS eigen extensions are properly loaded.
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
ParametersT< TrackParametersDim, Charged, PlaneSurface > AtaPlane