40 declareProperty(
"UsePt",
m_usePt);
41 declareProperty(
"ExpPt",
m_expPt);
43 declareProperty(
"MinPt",
m_minPt);
57 return StatusCode::FAILURE;
66 ATH_MSG_FATAL(
"At most one of Pt and LogPt weighting may be selected");
67 return StatusCode::FAILURE;
71 return StatusCode::SUCCESS;
77 return StatusCode::SUCCESS;
84 std::vector<const TrackParameters*> perigeeList;
86 std::vector<const Trk::Track*>::const_iterator begin=VectorTrk.begin();
87 std::vector<const Trk::Track*>::const_iterator end=VectorTrk.end();
89 for (std::vector<const Trk::Track*>::const_iterator iter=begin;
92 if (std::isnan((*iter)->perigeeParameters()->parameters()[
Trk::d0]))
96 perigeeList.push_back((*iter)->perigeeParameters());
100 return findSeed(perigeeList,constraint);
108 std::vector<Trk::DoubleAndWeight> ZPositions;
116 if ( !ZPositions.empty() )
119 ATH_MSG_DEBUG(
"Resulting mean Z position found: " << ZResult);
123 ATH_MSG_DEBUG(
"No tracks with sufficient weight; return z position = 0");
135 std::vector<Trk::DoubleAndWeight>
139 std::vector<Trk::DoubleAndWeight> ZPositions;
146 ATH_MSG_WARNING(
"Neutrals not supported for seeding. Rejecting track...");
150 std::pair<double, double> z0AndWeight =
153 " with weight " << z0AndWeight.second);
155 if (z0AndWeight.second >= 0.01)
157 ZPositions.push_back(z0AndWeight);
165 std::vector<Trk::DoubleAndWeight>
169 const EventContext& ctx = Gaudi::Hive::currentContext();
170 Cache& cache = *m_cache;
174 constraintkey.x() = constraint->
position().x();
175 constraintkey.y() = constraint->
position().y();
178 constraintkey.x() = std::numeric_limits<double>::max();
179 constraintkey.y() = std::numeric_limits<double>::min();
182 std::vector<Trk::DoubleAndWeight> ZPositions;
184 std::lock_guard<std::mutex> lock (cache.
m_mutex);
185 if (ctx.evt() != cache.
m_evt) {
194 ATH_MSG_WARNING(
"Neutrals not supported for seeding. Rejecting track...");
203 " with weight " << it->second.second);
206 if (it->second.second >= 0.01)
208 ZPositions.push_back (it->second);
219 std::pair<double, double>
224 static const double maxExpArg = log(std::numeric_limits<double>::max()/1.1);
226 std::unique_ptr<const Trk::ImpactParametersAndSigma> ipas;
227 if (constraint !=
nullptr && constraint->covariancePosition()(0,0)!=0) {
228 ipas = std::unique_ptr<const Trk::ImpactParametersAndSigma> (
m_IPEstimator->estimate (&iTrk, constraint));
231 std::pair<double, double> z0AndWeight;
232 if (ipas !=
nullptr && ipas->sigmad0 > 0)
234 z0AndWeight.first = ipas->IPz0 + constraint->
position().z();
235 double chi2IP = std::pow(ipas->IPd0/ipas->sigmad0, 2);
236 ATH_MSG_VERBOSE(
"d0 from tool: " << ipas->IPd0 <<
" error: " << ipas->sigmad0 <<
" chi2: " << chi2IP);
243 z0AndWeight.second = 1.;
248 if (constraint !=
nullptr)
ATH_MSG_WARNING(
"Unable to compute impact parameter significance; setting IPWeight = 1");
250 z0AndWeight.second = 1.;
259 z0AndWeight.second *= std::pow(Pt,
m_expPt);
263 z0AndWeight.second *= log(std::max(Pt /
m_minPt, 1.001));
274 ATH_MSG_WARNING(
"Multi-seeding requested but seed finder not able to operate in that mode, returning no seeds");
275 return std::vector<Amg::Vector3D>(0);
283 ATH_MSG_WARNING(
"Multi-seeding requested but seed finder not able to operate in that mode, returning no seeds");
284 return std::vector<Amg::Vector3D>(0);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
const Amg::Vector3D & position() const
Access method for the position.
std::vector< Trk::DoubleAndWeight > getPositionsCached(const std::vector< const Trk::TrackParameters * > &perigeeList, const xAOD::Vertex *constraint) const
virtual StatusCode finalize() override
virtual StatusCode initialize() override
std::pair< double, double > estimateWeight(const Trk::Perigee &iTrk, const xAOD::Vertex *constraint) const
Estimate z-position and weight for one track.
std::vector< Trk::DoubleAndWeight > getPositionsUncached(const std::vector< const Trk::TrackParameters * > &perigeeList, const xAOD::Vertex *constraint) const
virtual std::vector< Amg::Vector3D > findMultiSeeds(const std::vector< const Trk::Track * > &vectorTrk, const xAOD::Vertex *constraint=0) const override final
Finds full vector of linearization points from a vector of tracks and returns it as an Amg::Vector3D ...
ToolHandle< IMode1dFinder > m_mode1dfinder
ZScanSeedFinder(const std::string &t, const std::string &n, const IInterface *p)
ToolHandle< ITrackToVertexIPEstimator > m_IPEstimator
virtual Amg::Vector3D findSeed(const std::vector< const Trk::Track * > &vectorTrk, const xAOD::Vertex *constraint=0) const override final
Finds a linearization point out of a vector of tracks and returns it as an Amg::Vector3D object.
virtual ~ZScanSeedFinder()
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
const Amg::Vector3D & position() const
Returns the 3-pos.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
@ z
global position (cartesian)
ParametersBase< TrackParametersDim, Charged > TrackParameters
Vertex_v1 Vertex
Define the latest version of the vertex class.
std::pair< double, double > value_t
EventContext::ContextEvt_t m_evt
std::pair< Trk::Perigee, Amg::Vector2D > key_t