ATLAS Offline Software
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"
12 #include "AthenaKernel/CLASS_DEF.h"
13 #include <algorithm>
14 
15 typedef std::pair<HepMcParticleLink,ElementLink<xAOD::TruthParticleContainer> > xAODTruthParticleLink;
16 
19  return l1.first < l2.first;
20  }
22  return operator()(*l1,*l2);
23  }
24 };
25 
26 class xAODTruthParticleLinkVector : public DataVector<xAODTruthParticleLink> {
27 public:
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
get_generator_info.result
result
Definition: get_generator_info.py:21
TruthParticleContainer.h
xAODTruthParticleLinkVector::find
ElementLink< xAOD::TruthParticleContainer > find(const HepMcParticleLink &hepMCLink) const
Definition: xAODTruthParticleLink.h:28
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
skel.l2
l2
Definition: skel.GENtoEVGEN.py:399
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
DataVector< xAODTruthParticleLink >::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
xAODTruthParticleLinkVector
Definition: xAODTruthParticleLink.h:26
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
skel.l1
l1
Definition: skel.GENtoEVGEN.py:398
CLASS_DEF.h
macros to associate a CLID to a type
DataVector< xAODTruthParticleLink >::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.