37#include "CLHEP/Vector/LorentzVector.h"
38#include "CLHEP/Vector/ThreeVector.h"
39#include "CLHEP/Geometry/Vector3D.h"
60#define InDetImprovedJetFitterVxFinder_DEBUGAddOns
72 {
return first > other.first; }
82 {
return first > other.first; }
89 declareInterface< ISecVertexInJetFinder >(
this) ;
99 msg(MSG::ERROR) <<
"Could not find TrackSelector tool." <<
endmsg;
100 return StatusCode::FAILURE;
101 }
else msg(MSG::INFO) <<
" JetFitterTrackSelector retrieved" <<
endmsg;
104 msg(MSG::ERROR) <<
"Could not find TwoTrackVtxFinder tool." <<
endmsg;
105 return StatusCode::FAILURE;
106 }
else msg(MSG::INFO) <<
" JetFitterTwoTrackVtxFinder retrieved" <<
endmsg;
109 msg(MSG::ERROR) <<
"Could not find V0Finder tool." <<
endmsg;
110 return StatusCode::FAILURE;
111 }
else msg(MSG::INFO) <<
" JetFitterV0Finder retrieved" <<
endmsg;
114 msg(MSG::ERROR) <<
"Could not find JetFitterMultiStageFit tool." <<
endmsg;
115 return StatusCode::FAILURE;
116 }
else msg(MSG::INFO) <<
" JetFitterMultiStageFit retrieved" <<
endmsg;
118 return StatusCode::SUCCESS;
124 const TLorentzVector & jetMomentum,
125 const std::vector<const xAOD::IParticle*> & inputTracks)
const
136 ATH_MSG_DEBUG(
"the selected tracks now are " << mySelectedTracksInJet );
137 std::vector< const Trk::ITrackLink* > primaryTracks = mySelectedTracksInJet->
getPrimaryTrackLinks();
142 const std::vector< const xAOD::Vertex* > vertexCandidates = twoTrackVertexCandidates->
getTwoTrackVertice();
146 std::vector< const Trk::ITrackLink* > tracksToUseInFirstFit;
147 std::vector< const Trk::ITrackLink* > tracksToUseInSecondFit;
151 tracksToUseInFirstFit, tracksToUseInSecondFit, JFseedDirection );
154 ATH_MSG_DEBUG(
"Sorting track collection (tracksToUseInFirstFit) by pT..." );
156 ATH_MSG_DEBUG(
"Sorting track collection (tracksToUseInSecondFit) by pT..." );
159 delete twoTrackVertexCandidates;
166 primaryVertex.covariancePosition(),
174 tracksToUseInFirstFit,
175 tracksToUseInSecondFit,
179 if (myJetCandidate ==
nullptr) {
181 delete myTwoTrackVerticesInJet;
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)