23using HepGeom::Point3D;
30 const std::string& name,
31 const IInterface* parent)
34 declareInterface<ConversionFinderUtils>(
this);
45 return StatusCode::SUCCESS;
49 return StatusCode::SUCCESS;
62 double momFraction = mom_pos.mag()/(mom_pos.mag() + mom_neg.mag());
80 if(trk_hit_pos.mag() > m->globalPosition().mag()) first_pos_meas = m;
90 if(trk_hit_neg.mag() > m->globalPosition().mag()) first_neg_meas = m;
93 double distance = 1000.;
97 std::sqrt(std::pow(trk_hit_pos[0] - trk_hit_neg[0],2.) + std::pow(trk_hit_pos[1] - trk_hit_neg[1],2.) +
98 std::pow(trk_hit_pos[2] - trk_hit_neg[2],2.));
122 double p = momentum.mag();
124 distance = std::sqrt(std::pow(delta.mag(),2.) - std::pow((delta.adjoint()*momentum)[0]/p,2.));
132 std::unique_ptr<Trk::Track>
138 auto fq = track->fitQuality()->uniqueClone();
139 if(!fq)
return nullptr;
142 auto ntsos = std::make_unique<Trk::TrackStates>();
144 if(!tsos) {
return nullptr;}
147 for(its=tsos->
begin();its!=itse;++its) {
149 std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
155 ntsos->push_back(per_tsos);
160 return std::make_unique<Trk::Track>(info, std::move(ntsos), std::move(fq));
168 initVxCandidate->
position().y()+guessVertex.y(),
169 initVxCandidate->
position().z()+guessVertex.z());
171 Amg::Vector3D globalVertexPosition(correctVertex.x(),correctVertex.y(),correctVertex.z());
173 std::vector<Trk::VxTrackAtVertex> tmpVTAV;
175 const std::vector<Trk::VxTrackAtVertex> &trkAtVtx = initVxCandidate->
vxTrackAtVertex();
176 for (
const auto& vtxTrack : trkAtVtx) {
178 const AmgVector(5)& iv = vtxPer->parameters();
185 0., 0., iv[2], iv[3], iv[4], std::move(em))
190 tmpVTAV.push_back(trkV);
193 if(tmpVTAV.size()!=2)
return nullptr;
199 for (
const auto& vtxTrack : tmpVTAV) {
#define AmgSymMatrix(dim)
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
static double momFraction(const Trk::TrackParameters *per1, const Trk::TrackParameters *per2)
helper functions
static xAOD::Vertex * correctVxCandidate(xAOD::Vertex *, Amg::Vector3D)
Correct VxCandidate with respect to a user defined vertex.
virtual ~ConversionFinderUtils()
double distBetweenTracks(const Trk::Track *trk_pos, const Trk::Track *trk_neg) const
Approximate distance of minimum approach between tracks in pair.
virtual StatusCode initialize() override
virtual StatusCode finalize() override
static const InterfaceID & interfaceID()
ConversionFinderUtils(const std::string &type, const std::string &name, const IInterface *parent)
static std::unique_ptr< Trk::Track > addNewPerigeeToTrack(const Trk::Track *track, const Trk::Perigee *mp)
Add new perigee to track.
Simple helper class for defining track parameters for charged particles.
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.
virtual const Amg::Vector3D & globalPosition() const =0
Interface method to get the global Position.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
std::unique_ptr< ParametersBase< DIM, T > > uniqueClone() const
clone method for polymorphic deep copy returning unique_ptr; it is not overriden, but uses the existi...
Class describing the Line to which the Perigee refers to.
std::unique_ptr< ParametersT< DIM, T, PerigeeSurface > > createUniqueParameters(double l1, double l2, double phi, double theta, double qop, std::optional< AmgSymMatrix(DIM)> cov=std::nullopt) const
Use the Surface as a ParametersBase constructor, from local parameters.
Contains information about the 'fitter' of this track.
represents the track state (measurement, material, fit parameters and quality) at a surface.
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
const DataVector< const MeasurementBase > * measurementsOnTrack() const
return a pointer to a vector of MeasurementBase (NOT including any that come from outliers).
const Perigee * perigeeParameters() const
return Perigee.
The VxTrackAtVertex is a common class for all present TrkVertexFitters The VxTrackAtVertex is designe...
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
const Amg::Vector3D & position() const
Returns the 3-pos.
static std::string release
Eigen::Matrix< double, 3, 1 > Vector3D
static const InterfaceID IID_IConversionFinderUtils("InDet::ConversionFinderUtils", 1, 0)
DataVector< const Trk::TrackStateOnSurface > TrackStates
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
ParametersBase< TrackParametersDim, Charged > TrackParameters
Vertex_v1 Vertex
Define the latest version of the vertex class.