10#include "GaudiKernel/MsgStream.h"
11#include "GaudiKernel/DataSvc.h"
12#include "GaudiKernel/PhysicalConstants.h"
43 return StatusCode::SUCCESS;
53 ATH_MSG_WARNING(
"xAOD Pileup Truth Particles are already available in the event");
54 return StatusCode::SUCCESS;
63 xTruthPileupParticleContainer->setStore( xTruthPileupParticleAuxContainer );
70 return StatusCode::FAILURE;
90 float this_abseta = theParticle->abseta();
91 float this_pt = theParticle->pt();
98 xTruthPileupParticleContainer->
push_back( xTruthParticle );
101 *xTruthParticle=*theParticle;
103unsigned int particleOutCome;
106unsigned int particleOrigin;
110 originDecorator(*xTruthParticle) = particleOrigin;
111 outcomeDecorator(*xTruthParticle) = particleOutCome;
113 classificationDecorator(*xTruthParticle) =
result;
114 parenthadronPIDDecorator(*xTruthParticle) = hadron_pdg;
119 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
ATLAS-specific HepMC functions.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
value_type push_back(value_type pElem)
Add an element to the end of the collection.
std::string m_xaodTruthParticleContainerName
double m_photon_pt_selection
Selection values for keeping photons and leptons.
double m_lepton_pt_selection
virtual StatusCode initialize()
Function initialising the algorithm.
double m_abseta_selection
ToolHandle< IMCTruthClassifier > m_classifier
std::string m_xaodTruthPileupParticleContainerName
The key for the output xAOD truth containers.
PileupTruthParticleSlimmer(const std::string &name, ISvcLocator *svcLoc)
Regular algorithm constructor.
bool m_forceRerun
a flag to force rerunning (useful for rerunning on ESDs)
virtual StatusCode execute()
Function executing the algorithm.
SG::Decorator< T, ALLOC > Decorator
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
void classify(ToolHandle< IMCTruthClassifier > &m_classif, const xAOD::TruthParticle *theParticle, unsigned int &particleOutCome, unsigned int &result, int &hadron_pdg, unsigned int &particleType, unsigned int &particleOrigin)
bool isPhoton(const T &p)
bool isElectron(const T &p)
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
TruthParticleAuxContainer_v2 TruthParticleAuxContainer
Declare the latest version of the truth particle auxiliary container.
TruthParticle_v1 TruthParticle
Typedef to implementation.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.