38#include "CLHEP/Vector/LorentzVector.h"
39#include "CLHEP/Vector/ThreeVector.h"
40#include "CLHEP/Geometry/Vector3D.h"
61#define InDetImprovedJetFitterVxFinder_DEBUGAddOns
73 {
return first > other.first; }
83 {
return first > other.first; }
90 declareInterface< ISecVertexInJetFinder >(
this) ;
100 msg(MSG::ERROR) <<
"Could not find TrackSelector tool." <<
endmsg;
101 return StatusCode::FAILURE;
102 }
else msg(MSG::INFO) <<
" JetFitterTrackSelector retrieved" <<
endmsg;
105 msg(MSG::ERROR) <<
"Could not find TwoTrackVtxFinder tool." <<
endmsg;
106 return StatusCode::FAILURE;
107 }
else msg(MSG::INFO) <<
" JetFitterTwoTrackVtxFinder retrieved" <<
endmsg;
110 msg(MSG::ERROR) <<
"Could not find V0Finder tool." <<
endmsg;
111 return StatusCode::FAILURE;
112 }
else msg(MSG::INFO) <<
" JetFitterV0Finder retrieved" <<
endmsg;
115 msg(MSG::ERROR) <<
"Could not find JetFitterMultiStageFit tool." <<
endmsg;
116 return StatusCode::FAILURE;
117 }
else msg(MSG::INFO) <<
" JetFitterMultiStageFit retrieved" <<
endmsg;
119 return StatusCode::SUCCESS;
125 const TLorentzVector & jetMomentum,
126 const std::vector<const xAOD::IParticle*> & inputTracks)
const
137 ATH_MSG_DEBUG(
"the selected tracks now are " << mySelectedTracksInJet );
138 std::vector< const Trk::ITrackLink* > primaryTracks = mySelectedTracksInJet->
getPrimaryTrackLinks();
143 const std::vector< const xAOD::Vertex* > vertexCandidates = twoTrackVertexCandidates->
getTwoTrackVertice();
147 std::vector< const Trk::ITrackLink* > tracksToUseInFirstFit;
148 std::vector< const Trk::ITrackLink* > tracksToUseInSecondFit;
152 tracksToUseInFirstFit, tracksToUseInSecondFit, JFseedDirection );
155 ATH_MSG_DEBUG(
"Sorting track collection (tracksToUseInFirstFit) by pT..." );
157 ATH_MSG_DEBUG(
"Sorting track collection (tracksToUseInSecondFit) by pT..." );
160 delete twoTrackVertexCandidates;
167 primaryVertex.covariancePosition(),
175 tracksToUseInFirstFit,
176 tracksToUseInSecondFit,
180 if (myJetCandidate ==
nullptr) {
190 std::vector<Trk::VxJetCandidate*> myCandidates;
192 myCandidates.push_back(myJetCandidate);
195 myTwoTrackVerticesInJet,
196 mySelectedTracksInJet);
205 const TLorentzVector & ,
206 const std::vector<const Trk::ITrackLink*> & ,
207 const std::vector<const Trk::ITrackLink*> & ,
230 if ( trackCollection.empty() )
return;
233 ( trackCollection.front()->parameters() )->pT() <<
235 ( trackCollection.back()->parameters() )->pT() );
238 trackCollection.end(),
241 return ( (TL1->parameters())->pT() < (TL2->parameters())->pT() );
245 ( trackCollection.front()->parameters() )->pT() <<
247 ( trackCollection.back()->parameters() )->pT() );
254 std::vector<std::string>
InDetImprovedJetFitterVxFinder(const std::string &t, const std::string &n, const IInterface *p)
virtual std::vector< std::string > trackDecorationNames() const override
Return a list of the names of track decorations created by this tool, in order to allow them to be lo...
ToolHandle< JetFitterTrackSelectorTool > m_theTrackSelector
void sortTrackCollectionByPt(std::vector< const Trk::ITrackLink * > &) const
~InDetImprovedJetFitterVxFinder()
ToolHandle< JetFitterMultiStageFit > m_multiStageFitter
virtual StatusCode initialize() override
ToolHandle< JetFitterTwoTrackVtxFinderTool > m_theTwoTrackVtxFinderTool
virtual Trk::VxSecVertexInfo * findSecVertex(const EventContext &ctx, const xAOD::Vertex &primaryVertex, const TLorentzVector &jetMomentum, const std::vector< const xAOD::IParticle * > &inputTracks) const override
ToolHandle< JetFitterV0FinderTool > m_theV0FinderTool
void doTheFit(Trk::VxJetCandidate *myJetCandidate, bool performClustering=true) const
An abstract class which is meant to represent an element link to the Trk::Track or Trk::TrackParticle...
Trk::RecVertex inherits from Trk::Vertex.
const std::vector< const ITrackLink * > & getSecondaryTrackLinks() const
Get the secondary tracks (please do not delete the pointers).
const std::vector< const ITrackLink * > & getPrimaryTrackLinks() const
Get the priamry tracks (please do not delete the pointers).
const std::vector< const xAOD::Vertex * > & getTwoTrackVertice() const
Get the two track vertices (please do not delete the pointers).
void setSVOwnership(bool Ownership)
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
float chiSquared() const
Returns the of the vertex fit as float.
const Amg::Vector3D & position() const
Returns the 3-pos.
Eigen::Matrix< double, 3, 1 > Vector3D
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Vertex_v1 Vertex
Define the latest version of the vertex class.
bool operator<(const TrackParticle_pair &other) const
const Trk::TrackParticleBase * second
TrackParticle_pair(double p1, const Trk::TrackParticleBase *p2)
const Trk::Track * second
bool operator<(const Track_pair &other) const
Track_pair(double p1, const Trk::Track *p2)