Loading [MathJax]/jax/input/TeX/config.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
9 #include "AthLinks/ElementLink.h"
57 return StatusCode::SUCCESS;
65 return StatusCode::SUCCESS;
72 const EventContext& ctx = Gaudi::Hive::currentContext();
78 if(isVtxDeco_available)
return;
81 std::vector<std::pair<const xAOD::Vertex*,float> > vxWithWeight;
90 for (
const auto *
const vtx : *vtxCont) {
94 const auto& trkLinks=vtx->trackParticleLinks();
95 const size_t nTrackLinks=trkLinks.size();
96 for (
unsigned i=0;
i<nTrackLinks;++
i) {
97 if (trkLinks[
i].
isValid() && *(trkLinks[
i]) == trk) {
98 vxWithWeight.emplace_back(vtx,vtx->trackWeights()[
i]);
105 std::sort(vxWithWeight.begin(),vxWithWeight.end(),
106 [](std::pair<const xAOD::Vertex*,float>&
a, std::pair<const xAOD::Vertex*,float>&
b){ return a.second > b.second; } );
110 std::vector<ElementLink<xAOD::VertexContainer>> AMVFVertices;
111 std::vector<float> AMVFWeights;
112 AMVFVertices.reserve(vxWithWeight.size());
113 AMVFWeights.reserve(vxWithWeight.size());
115 for (
const auto&
p : vxWithWeight) {
116 AMVFVertices.emplace_back(
p.first,*vtxCont,ctx);
117 AMVFWeights.emplace_back(
p.second);
121 vtxDeco(*trk) = std::move(AMVFVertices);
122 wgtDeco(*trk) = std::move(AMVFWeights);
130 const EventContext& ctx = Gaudi::Hive::currentContext();
142 ATH_MSG_WARNING(
"Unable to retrieve xAOD::VertexContainer, \"" <<
m_vtxContKey.key() <<
"\", returning without applying decorations!");
bool isAvailable()
Test to see if this variable exists in the store, for the referenced object.
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
const std::string & key() const
Return the StoreGate ID for the referenced object.
::StatusCode StatusCode
StatusCode definition for legacy code.
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
Handle class for adding a decoration to an object.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
#define ATH_MSG_WARNING(x)
Class describing a TrackParticle.