26 return StatusCode::SUCCESS;
34 if (!inputCollection.
isValid()) {
35 ATH_MSG_ERROR(
"Could not get input truth collection " << inputCollection.
name() <<
" from store " << inputCollection.
store());
36 return StatusCode::FAILURE;
38 ATH_MSG_DEBUG(
"Found input truth collection " << inputCollection.
name() <<
" in store " << inputCollection.
store());
39 const float refPVtxZ =
getPVtxZ(inputCollection);
43 if( !particles.isValid() ) {
45 return StatusCode::FAILURE;
48 decHandle( *truthParticle ) = refPVtxZ;
50 return StatusCode::SUCCESS;
55 const HepMC::GenEvent* genEvt = *(inputCollection->begin());
64 HepMC::FourVector pmvxpos=hScatVx->position();
65 return static_cast<float>(pmvxpos.z());
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Handle class for adding a decoration to an object.
An algorithm that can be simultaneously executed in multiple threads.
virtual StatusCode initialize() override
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadHandleKey< xAOD::IParticleContainer > m_particleKey
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decKey
virtual float getPVtxZ(SG::ReadHandle< McEventCollection > &inputCollection) const
SG::ReadHandleKey< McEventCollection > m_inputTruthCollectionKey
PileUpTruthDecoration(const std::string &name, ISvcLocator *pSvcLocator)
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::string store() const
Return the name of the store holding the object we are proxying.
const std::string & name() const
Return the StoreGate ID for the referenced object.
Handle class for adding a decoration to an object.
Class providing the definition of the 4-vector interface.
GenVertex * barcode_to_vertex(const GenEvent *e, int id)
const HepMC::GenVertex * ConstGenVertexPtr