|
ATLAS Offline Software
|
Go to the documentation of this file.
15 const std::string&
name,
16 const IInterface *
parent) :
18 m_assocTracksName(
"GhostTrack")
20 declareInterface<DiTauToolBase > (
this);
33 return StatusCode::SUCCESS;
38 const EventContext& ctx)
const {
53 for (
const auto *
const vtx : *vxContainer) {
61 if (vxPrimary ==
nullptr) {
63 " Continue without Tau Vertex Association.");
64 return StatusCode::SUCCESS;
68 pDiTau->
setVertex(vxContainer.get(), vxPrimary);
72 ATH_MSG_DEBUG(
"TJVA enabled -> try to find new PV for the tau candidate");
76 if (newPrimaryVertexLink.
isValid()) {
88 return StatusCode::SUCCESS;
94 const EventContext& ctx)
const
101 std::vector<const xAOD::TrackParticle*> assocTracks;
111 std::vector<float> jvf;
112 jvf.resize(vertices->
size());
113 for (
size_t iVertex = 0; iVertex < vertices->
size(); ++iVertex) {
121 for (
size_t iVertex = 0; iVertex < jvf.size(); ++iVertex) {
122 if (jvf.at(iVertex) > maxJVF) {
123 maxJVF = jvf.at(iVertex);
139 float sumTrackPV = 0.;
140 float sumTrackAll = 0.;
141 for (
size_t iTrack = 0; iTrack < tracks.size(); ++iTrack)
145 if (ptvtx !=
nullptr) {
149 sumTrackAll +=
track->pt();
152 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.
Handle class for reading from StoreGate.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual ~VertexFinder()
Destructor.