|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "AthLinks/ElementLink.h"
10 #include "GaudiKernel/MsgStream.h"
11 #include "GaudiKernel/DataSvc.h"
12 #include "GaudiKernel/PhysicalConstants.h"
36 return StatusCode::SUCCESS;
44 ATH_MSG_WARNING(
"xAOD Electron Truth Particles are already available in the event");
45 return StatusCode::SUCCESS;
53 xTruthParticleContainerElectron->setStore(xTruthParticleAuxContainerElectron);
61 return StatusCode::FAILURE;
65 for (itr = xTruthEventContainer->
begin(); itr!=xTruthEventContainer->
end(); ++itr) {
67 unsigned int nPart = (*itr)->nTruthParticles();
68 std::vector<int> uniqueID_list;
71 for (
unsigned int iPart = 0; iPart < nPart; ++iPart) {
79 if (uniqueID_list.size() > 0){
80 found = (
std::find(uniqueID_list.begin(), uniqueID_list.end(), my_uniqueID) != uniqueID_list.end());
85 uniqueID_list.push_back(my_uniqueID);
92 xTruthParticleContainerElectron->
push_back( xTruthParticle );
95 *xTruthParticle=*theParticle;
98 if (zero_uniqueID!=0 || dup_uniqueID!=0)
ATH_MSG_INFO(
"Found " << zero_uniqueID <<
" uniqueID=0 particles and " << dup_uniqueID <<
" duplicated");
101 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
Const iterator class for DataVector/DataList.
std::string find(const std::string &s)
return a remapped string
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::string m_xaodTruthEventContainerName
virtual StatusCode execute()
Function executing the algorithm.
double m_abseta_selection
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Auxiliary store for the truth vertices.
TruthParticleAuxContainer_v1 TruthParticleAuxContainer
Declare the latest version of the truth particle auxiliary container.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Class describing a truth particle in the MC record.
TruthParticle_v1 TruthParticle
Typedef to implementation.
#define CHECK(...)
Evaluate an expression and check for errors.
constexpr int UNDEFINED_ID
std::string m_xaodTruthParticleContainerName
Helpers for checking error return status codes and reporting errors.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
double m_el_pt_selection
Selection values for keeping taus and leptons.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
#define ATH_MSG_WARNING(x)
xAODTruthParticleSlimmerElectron(const std::string &name, ISvcLocator *svcLoc)
Regular algorithm constructor.
std::string m_xaodTruthParticleContainerNameElectron
The key for the output xAOD truth containers.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
virtual StatusCode initialize()
Function initialising the algorithm.