|
ATLAS Offline Software
|
Go to the documentation of this file.
10 const std::string&
name,
11 const IInterface *
parent) :
13 m_assocTracksName(
"GhostTrack")
15 declareInterface<DiTauToolBase > (
this);
28 return StatusCode::SUCCESS;
33 const EventContext& ctx)
const {
48 for (
const auto *
const vtx : *vxContainer) {
56 if (vxPrimary ==
nullptr) {
58 " Continue without Tau Vertex Association.");
59 return StatusCode::SUCCESS;
63 pDiTau->
setVertex(vxContainer.get(), vxPrimary);
67 ATH_MSG_DEBUG(
"TJVA enabled -> try to find new PV for the tau candidate");
71 if (newPrimaryVertexLink.
isValid()) {
83 return StatusCode::SUCCESS;
89 const EventContext& ctx)
const
96 std::vector<const xAOD::TrackParticle*> assocTracks;
106 std::vector<float> jvf;
107 jvf.resize(vertices->
size());
108 for (
size_t iVertex = 0; iVertex < vertices->
size(); ++iVertex) {
116 for (
size_t iVertex = 0; iVertex < jvf.size(); ++iVertex) {
117 if (jvf.at(iVertex) > maxJVF) {
118 maxJVF = jvf.at(iVertex);
134 float sumTrackPV = 0.;
135 float sumTrackAll = 0.;
136 for (
size_t iTrack = 0; iTrack < tracks.size(); ++iTrack)
140 if (ptvtx !=
nullptr) {
144 sumTrackAll +=
track->pt();
147 return sumTrackAll!=0. ? sumTrackPV/sumTrackAll : 0.;
void setVertex(const xAOD::VertexContainer *cont, const xAOD::Vertex *vertex)
char data[hepevt_bytes_allocation_ATLAS]
virtual StatusCode initialize() override
Tool initializer.
void setDetail(DiTauJetParameters::Detail detail, int value)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
VertexFinder(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
SG::ReadHandleKey< xAOD::VertexContainer > m_primVtxContainerName
static float getJetVertexFraction(const xAOD::Vertex *, const std::vector< const xAOD::TrackParticle * > &, const jet::TrackVertexAssociation *)
bool isValid() const
Test to see if the link can be dereferenced.
std::vector< const T * > getAssociatedObjects(const std::string &name) const
get associated objects as a vector<object> this compact form throws an exception if the object is not...
ElementLink< xAOD::VertexContainer > getPV_TJVA(const xAOD::DiTauJet *, const xAOD::VertexContainer *, float &maxJVF, const EventContext &ctx) const
::StatusCode StatusCode
StatusCode definition for legacy code.
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
Class to hold N-to-one aassociations between tracks and vertices.
SG::ReadHandleKey< jet::TrackVertexAssociation > m_trackVertexAssocName
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
size_t index() const
Return the index of this element within its container.
const xAOD::Vertex * associatedVertex(const xAOD::TrackParticle *trk) const
void setVertexLink(const VertexLink_t &vertexLink)
ElementLink implementation for ROOT usage.
const JetLink_t & jetLink() const
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
virtual StatusCode execute(DiTauCandidateData *data, const EventContext &ctx) const override
Execute - called for each Ditau candidate.
std::string m_assocTracksName
Class describing a TrackParticle.
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual ~VertexFinder()
Destructor.