12 declareInterface< JetFitterTrackSelectorTool >(
this);
20 msg(MSG::ERROR) <<
" Unable to retrieve InDet::InDetDetailedTrackSelectorTool" <<
endmsg;
21 return StatusCode::FAILURE;
25 msg(MSG::ERROR) <<
" Unable to retrieve InDet::InDetJetFitterUtils/InDetJetFitterUtils" <<
endmsg;
26 return StatusCode::FAILURE;
30 msg(MSG::ERROR) <<
" Unable to retrieve Trk::Extrapolator/InDetExtrapolator" <<
endmsg;
31 return StatusCode::FAILURE;
34 return StatusCode::SUCCESS;
39 const TLorentzVector &jetMomentum,
40 const std::vector<const xAOD::IParticle *> &inputTracks)
const {
46 ATH_MSG_DEBUG(
"Doing track selection on " << inputTracks.size() <<
" tracks ... " );
54 std::vector< const Trk::ITrackLink* > primaryTrackLinks;
55 std::vector< const Trk::ITrackLink* > secondaryTrackLinks;
58 std::vector<const xAOD::IParticle *>::const_iterator trk_iter = inputTracks.begin();
59 std::vector<const xAOD::IParticle*>::const_iterator trk_end = inputTracks.end();
62 for ( ; trk_iter != trk_end; ++trk_iter ) {
65 assert( tmp !=
nullptr );
80 if (
type == 1) primaryTrackLinks.push_back( link );
81 else if (
type == 2 ) secondaryTrackLinks.push_back( link );
95 return selectedTracks;
102 std::vector<std::string> out;
103 std::string toolname = this->name();
104 std::string delimiter =
"_";
105 std::string::size_type firstDelimiter = toolname.find(delimiter);
106 std::string sub = toolname.substr(0, firstDelimiter);
110 return std::string(
"JetFitter_TrackCompatibility_") + sub;
116 std::vector<std::string>
123 const TLorentzVector &jetMomentum,
130 if ( !
m_trkFilter->decision( track, &primaryVertex ) ) {
131 compatibilityDecorator ( track ) = 0.;
137 std::unique_ptr<const Trk::TrackParameters> myMeasuredPerigee(
m_extrapolator->extrapolate(
138 Gaudi::Hive::currentContext(),track.perigeeParameters(),mySurface ));
140 if ( !myMeasuredPerigee) {
141 ATH_MSG_DEBUG(
" Extrapolation to primary vertex failed. Skipping track " );
142 compatibilityDecorator ( track ) = 0.;
150 primaryVertex.covariancePosition(),
154 Amg::Vector3D jetMomSpatial( jetMomentum.X(),jetMomentum.Y(),jetMomentum.Z() );
155 double compatibilityValue =
m_jetFitterUtils->compatibility( *myMeasuredPerigee,primaryVertexRecVertex ).first;
158 primaryVertexRecVertex );
161 ATH_MSG_DEBUG(
"compatibilityValue = " << compatibilityValue );
162 compatibilityDecorator ( track ) = compatibilityValue;
173 if ( ( compatibilityValue < 0 &&
174 TMath::Prob( fabs( compatibilityValue ),2 ) < cutCompatibilityPVforNegTracks) ||
175 ( compatibilityValue >= 0 &&
176 TMath::Prob( fabs( compatibilityValue ),2 ) < cutCompatibilityPVforPosTracks ) )
bool setElement(ElementType element)
Set to point to an element.
static double get3DLifetimeSignOfTrack(const Trk::TrackParameters &track, const Amg::Vector3D &jetMomentum, const Trk::RecVertex &primaryVertex)
SG::Decorator< T, ALLOC > Decorator
Element link to XAOD TrackParticle.
Class describing the Line to which the Perigee refers to.
Trk::RecVertex inherits from Trk::Vertex.
void setPrimaryTrackLinks(std::vector< const ITrackLink * > &primaryTrackLinks)
Set the primary tracks (takes ownership of pointers)
void setSecondaryTrackLinks(std::vector< const ITrackLink * > &secondaryTracLinks)
Set the secondary tracks (takes ownership of pointers)
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
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.