ATLAS Offline Software
Loading...
Searching...
No Matches
SumPtVertexWeightCalculator.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
8
10#include "xAODTracking/Vertex.h"
11
12namespace Trk {
13
16{
17 return StatusCode::SUCCESS;
18} // end of initialize method
19
20StatusCode
22{
23 return StatusCode::SUCCESS;
24}
25
26// class constructor implementation
28 const std::string& n,
29 const IInterface* p)
30 : AthAlgTool(t, n, p)
31{
32 declareInterface<IVertexWeightCalculator>(this);
33}
34
35double
37 const xAOD::Vertex& vertex) const
38{
39 double total_pt = 0;
40 ATH_MSG_VERBOSE("Estimating vertex sorting score from "
41 << vertex.nTrackParticles() << " tracks at vertex.");
42 for (const auto& elTrackParticle : vertex.trackParticleLinks()) {
43
44 if (not elTrackParticle.isValid()) {
46 "No valid link to tracks in xAOD::Vertex object. Skipping track for "
47 "signal compatibility (may be serious).");
48 continue;
49 }
50
51 const Trk::Perigee& perigee =
52 (*elTrackParticle.cptr())->perigeeParameters();
54 total_pt += std::pow(1. / perigee.parameters()[Trk::qOverP] *
55 sin(perigee.parameters()[Trk::theta]) / 1000.,
56 2);
57 } else {
58 total_pt += std::fabs(1. / perigee.parameters()[Trk::qOverP]) *
59 sin(perigee.parameters()[Trk::theta]) / 1000.;
60 }
61 }
62 ATH_MSG_DEBUG("Calculated vertex sumpt " << std::setprecision(3) << total_pt);
63 return total_pt;
64}
65
66}
67
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
SumPtVertexWeightCalculator(const std::string &t, const std::string &n, const IInterface *p)
constructor
virtual double estimateSignalCompatibility(const xAOD::Vertex &vertex) const override final
WeightCalculator.
Gaudi::Property< bool > m_doSumPt2Selection
Flag to Set SumPt^2 not SumPt as selection criteria.
::StatusCode StatusCode
StatusCode definition for legacy code.
Ensure that the ATLAS eigen extensions are properly loaded.
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
@ theta
Definition ParamDefs.h:66
@ qOverP
perigee
Definition ParamDefs.h:67
Vertex_v1 Vertex
Define the latest version of the vertex class.