Check that the current event passes this filter.
64 const EventContext& ctx = Gaudi::Hive::currentContext();
71 if(tracks->size() !=0) {
81 for (
const auto track : *tracks) {
85 std::unique_ptr<
AmgSymMatrix(5)> updateTrackCov =
nullptr;
86 float updatephi = -999;
87 float updatetheta = -999;
88 float updated0 = -999;
89 float updatez0 = -999;
90 float updateqOverP = -999;
91 float updateChi2 = -999;
92 bool usedPrimaryVertex =
false;
93 std::vector<float>
vec;
95 std::unique_ptr<const Trk::TrackParameters> trackParams =
nullptr;
101 if (vxContainer.isValid()) {
106 auto vtxSurface = std::make_unique<Trk::PerigeeSurface>(vtxPos);
107 trackParams =
m_extrapolator->extrapolate(ctx,*tPerigee,*vtxSurface);
108 std::unique_ptr<const Trk::ImpactParametersAndSigma> iPandSigma =
nullptr;
109 iPandSigma =
m_IPEstimator->estimate(trackParams.get(), vtx);
110 if(sqrt(iPandSigma->
IPd0*iPandSigma->
IPd0+iPandSigma->
IPz0*iPandSigma->
IPz0) < minIP){
111 minIP = sqrt(iPandSigma->
IPd0*iPandSigma->
IPd0+iPandSigma->
IPz0*iPandSigma->
IPz0);
114 ATH_MSG_VERBOSE(
"n vtx pos(x, y, z) IPd0 IPz0 : " << nVtx <<
" " << vtx->position().x() <<
" "<< vtx->position().y() <<
" "<< vtx->position().z() <<
" " << iPandSigma->
IPd0 <<
" " << iPandSigma->
IPz0);
121 return StatusCode::FAILURE;
132 auto recVtx = std::make_unique<xAOD::Vertex>();
133 recVtx->makePrivateStore(*closestVertex);
134 auto surface = std::make_unique<const Trk::PerigeeSurface>(globPos);
135 trackParams =
m_extrapolator->extrapolate(ctx,*tPerigee,*surface);
136 auto linearTrack = std::make_unique<Trk::VxTrackAtVertex>(0.,
nullptr,
nullptr, trackParams.get(),
nullptr);
140 ATH_MSG_VERBOSE(
"Updating linearized track parameters after vertex fit. Track weight = " << linearTrack->weight());
142 ATH_MSG_VERBOSE (
"track info after vertex track updator !"<<*linearTrack );
143 if(linearTrack->perigeeAtVertex()) {
145 updateqOverP = linearTrack->perigeeAtVertex()->parameters()[
Trk::qOverP];
146 updated0 = linearTrack->perigeeAtVertex()->parameters()[
Trk::d0];
147 updatez0 = linearTrack->perigeeAtVertex()->parameters()[
Trk::z0];
148 updatephi = linearTrack->perigeeAtVertex()->parameters()[
Trk::phi0];
149 updatetheta = linearTrack->perigeeAtVertex()->parameters()[
Trk::theta];
151 updateTrackCov = std::make_unique<AmgSymMatrix(5)>(*linearTrack->perigeeAtVertex()->covariance());
152 updateChi2 = linearTrack->trackQuality().chiSquared();
160 decoratorKVUqOverP(*
track) = updateqOverP;
161 decoratorKVUd0(*
track) = updated0;
162 decoratorKVUz0(*
track) = updatez0;
163 decoratorKVUphi(*
track) = updatephi;
164 decoratorKVUtheta(*
track) = updatetheta;
165 decoratorKVUChi2(*
track) = updateChi2;
166 decoratorKVUusedPV(*
track) = usedPrimaryVertex;
179 return StatusCode::SUCCESS;