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 );
82 if (
type == 1) primaryTrackLinks.push_back( link );
83 else if (
type == 2 ) secondaryTrackLinks.push_back( link );
97 return selectedTracks;
104 std::vector<std::string> out;
105 std::string toolname = this->name();
107 std::string::size_type firstDelimiter = toolname.find(
delimiter);
108 std::string sub = toolname.substr(0, firstDelimiter);
112 return std::string(
"JetFitter_TrackCompatibility_") + sub;
118 std::vector<std::string>
125 const TLorentzVector &jetMomentum,
129 SG::AuxElement::Decorator< float > compatibilityDecorator(
decorationName());
132 if ( !
m_trkFilter->decision( track, &primaryVertex ) ) {
133 compatibilityDecorator ( track ) = 0.;
139 std::unique_ptr<const Trk::TrackParameters> myMeasuredPerigee(
m_extrapolator->extrapolate(
140 Gaudi::Hive::currentContext(),track.perigeeParameters(),mySurface ));
142 if ( !myMeasuredPerigee) {
143 ATH_MSG_DEBUG(
" Extrapolation to primary vertex failed. Skipping track " );
144 compatibilityDecorator ( track ) = 0.;
152 primaryVertex.covariancePosition(),
156 Amg::Vector3D jetMomSpatial( jetMomentum.X(),jetMomentum.Y(),jetMomentum.Z() );
157 double compatibilityValue =
m_jetFitterUtils->compatibility( *myMeasuredPerigee,primaryVertexRecVertex ).first;
160 primaryVertexRecVertex );
163 ATH_MSG_DEBUG(
"compatibilityValue = " << compatibilityValue );
164 compatibilityDecorator ( track ) = compatibilityValue;
175 if ( ( compatibilityValue < 0 &&
176 TMath::Prob( fabs( compatibilityValue ),2 ) < cutCompatibilityPVforNegTracks) ||
177 ( compatibilityValue >= 0 &&
178 TMath::Prob( fabs( compatibilityValue ),2 ) < cutCompatibilityPVforPosTracks ) )
bool setElement(ElementType element)
Set link to point to an Element (slowest).
static double get3DLifetimeSignOfTrack(const Trk::TrackParameters &track, const Amg::Vector3D &jetMomentum, const Trk::RecVertex &primaryVertex)
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.
static const std::string delimiter("/")
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.