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;
74 const static SG::AuxElement::Decorator<unsigned int> originDecorator(
"classifierParticleOrigin");
75 const static SG::AuxElement::Decorator<unsigned int> typeDecorator(
"classifierParticleType");
76 const static SG::AuxElement::Decorator<unsigned int> outcomeDecorator(
"classifierParticleOutCome");
77 const static SG::AuxElement::Decorator<unsigned int> classificationDecorator(
"Classification");
78 const static SG::AuxElement::Decorator<int> parenthadronPIDDecorator(
"parentHadronID");
90 float this_abseta = theParticle->abseta();
91 float this_pt = theParticle->pt();
98 xTruthPileupParticleContainer->
push_back( xTruthParticle );
101 *xTruthParticle=*theParticle;
107 unsigned int particleOutCome;
110 unsigned int particleOrigin;
114 originDecorator(*xTruthParticle) = particleOrigin;
115 outcomeDecorator(*xTruthParticle) = particleOutCome;
117 classificationDecorator(*xTruthParticle) = result;
118 parenthadronPIDDecorator(*xTruthParticle) = hadron_pdg;
123 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.
ElementLink implementation for ROOT usage.
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.
void setDecayVtxLink(const ElementLink< TruthVertexContainer > &link)
Set the decay vertex of the particle.
void setProdVtxLink(const ElementLink< TruthVertexContainer > &link)
Set the production vertex of the particle.
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.