|
ATLAS Offline Software
|
Go to the documentation of this file.
24 declareInterface<IMuonTrackToSegmentTool>(
this);
33 return StatusCode::SUCCESS;
55 std::set<Identifier> chIds;
72 std::unique_ptr<Amg::Transform3D> surfaceTransformToBeDeleted;
73 double weightedDistanceSquared{0}, weightSquared{0};
82 rots.push_back(meas->
clone());
86 if (!
id.is_valid() ||
m_idHelperSvc->measuresPhi(
id))
continue;
96 if (!surfaceTransform) {
102 surfaceTransform = surfaceTransformToBeDeleted.get();
106 surfaceTransform = &(meas)->associatedSurface().transform();
107 }
else if (!surfaceTransform && !backupTransform) {
108 backupTransform = &(meas)->associatedSurface().transform();
111 if (!surfaceTransform) surfaceTransform = backupTransform;
113 double refDistance = (weightSquared > 0 ? weightedDistanceSquared / weightSquared : 1) - 100;
119 double minDist = -1e6;
124 if (!
pars || !
pars->covariance())
continue;
134 if (!surfaceTransform) {
135 ATH_MSG_DEBUG(
" failed to create a PlaneSurface for the track, cannot make segment!!! " << std::endl
143 closestPars = perigee;
144 minDist = (perigee->position() - refPos).
dot(
dir);
149 constexpr
double surfDim = 500.;
150 std::unique_ptr<Trk::PlaneSurface> surf = std::make_unique<Trk::PlaneSurface>(
transform, surfDim, surfDim);
153 if (!exPars || !exPars->covariance()) {
154 ATH_MSG_VERBOSE(
"First trial reaching the surface failed. This is presumably due to a too large momentum. Let's try with a dummy 1 GeV momentum");
155 std::unique_ptr<Trk::TrackParameters> cloned_pars {closestPars->
clone()};
157 cloned_pars->parameters()[
Trk::qOverP] = cloned_pars->charge() *OneOverGeV;
162 ATH_MSG_DEBUG(
" propagation failed!!! "<<*cloned_pars<<std::endl<<std::endl<<*surf);
184 globalToLocalMeasJacobian(
Trk::phi,
Trk::phi) = globalToLocalMeasAnglesJacobian(0, 0);
186 globalToLocalMeasJacobian(
Trk::theta,
Trk::phi) = globalToLocalMeasAnglesJacobian(0, 1);
190 AmgSymMatrix(5)
cov = exPars->covariance()->similarity(globalToLocalMeasJacobian);
193 if (!chIds.empty()) {
195 std::vector<Identifier>
holes;
197 std::vector<Identifier> holesChamber =
calculateHoles(ctx, chid, *exPars, rots.stdcont());
198 holes.insert(
holes.end(), holesChamber.begin(), holesChamber.end());
206 locPos,
locDir,
cov, surf.release(), std::move(rots), quality);
214 if (!InterSectSvc.isValid()) {
215 ATH_MSG_ERROR(
"Failed to retrieve chamber intersection service");
222 std::set<Identifier> hitsOnSegment;
225 if (mdt) hitsOnSegment.insert(mdt->
identify());
229 std::vector<Identifier>
holes;
230 for (
unsigned int ii = 0; ii <
intersect.tubeIntersects().size(); ++ii) {
234 if (hitsOnSegment.count(tint.
tubeId))
continue;
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
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...
#define CXXUTILS_TRAPPING_FP
virtual Amg::Transform3D AmdbLRSToGlobalTransform() const
virtual MeasurementBase * clone() const =0
Pseudo-Constructor.
virtual const Amg::Vector3D & center(const Identifier &) const override final
Return the center of the surface associated with this identifier In the case of silicon it returns th...
double innerTubeRadius() const
Returns the inner tube radius excluding the aluminium walls.
const Amg::Vector3D & position() const
Access method for the position.
Eigen::Matrix< double, 2, 1 > Vector2D
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
virtual const MuonGM::MdtReadoutElement * detectorElement() const override final
Returns the detector element, assoicated with the PRD of this class.
#define ATH_MSG_VERBOSE(x)
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
MuonSegment_v1 MuonSegment
Reference the current persistent version:
#define AmgSymMatrix(dim)
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
::StatusCode StatusCode
StatusCode definition for legacy code.
Eigen::Affine3d Transform3D
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
void globalToLocalDirection(const Amg::Vector3D &glodir, Trk::LocalDirection &locdir) const
This method transforms the global direction to a local direction wrt the plane.
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
represents the three-dimensional global direction with respect to a planar surface frame.
def dot(G, fn, nodesToHighlight=[])
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Tell the compiler to optimize assuming that FP may trap.
@ NoField
Field is set to 0., 0., 0.,.
represents the track state (measurement, material, fit parameters and quality) at a surface.
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
const Amg::Vector3D & momentum() const
Access method for the momentum.
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the point B' along the line B that's closest to a second line A.
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
#define ATH_MSG_WARNING(x)
Identifier identify() const
return the identifier -extends MeasurementBase
double chiSquared() const
returns the of the overall track fit
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
virtual ParametersBase< DIM, T > * clone() const override=0
clone method for polymorphic deep copy