ATLAS Offline Software
Loading...
Searching...
No Matches
xAODTruthParticleLink.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef XAODTRUTHPARTICLELINK_H
6#define XAODTRUTHPARTICLELINK_H
7
10#include "AthLinks/ElementLink.h"
13#include <algorithm>
14
15typedef std::pair<HepMcParticleLink,ElementLink<xAOD::TruthParticleContainer> > xAODTruthParticleLink;
16
19 return l1.first < l2.first;
20 }
22 return operator()(*l1,*l2);
23 }
24};
25
26class xAODTruthParticleLinkVector : public DataVector<xAODTruthParticleLink> {
27public:
29 auto result = std::lower_bound(begin(),end(), hepMCLink, [](const xAODTruthParticleLink* l, const HepMcParticleLink& hepLink ) { return l->first < hepLink;});
30 if( result != end() ) {
31 if( (*result)->first == hepMCLink ) return (*result)->second;
32 }
34 }
35};
36
38#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
An STL vector of pointers that by default owns its pointed-to elements.
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
const_iterator end() const noexcept
const_iterator begin() const noexcept
ElementLink< xAOD::TruthParticleContainer > find(const HepMcParticleLink &hepMCLink) const