10 #include "GaudiKernel/MsgStream.h"
11 #include "GaudiKernel/DataSvc.h"
12 #include "GaudiKernel/PhysicalConstants.h"
26 :
AthAlgorithm(
name, svcLoc ), m_classifier(
"MCTruthClassifier/MCTruthClassifier")
40 ATH_MSG_DEBUG(
"xAOD input TruthParticleContainer name = " << m_xaodTruthParticleContainerName );
41 ATH_MSG_DEBUG(
"xAOD output TruthPileupParticleContainer name = " << m_xaodTruthPileupParticleContainerName );
43 return StatusCode::SUCCESS;
51 if ( evtStore()->contains< xAOD::TruthParticleContainer >(m_xaodTruthPileupParticleContainerName) &&
53 ATH_MSG_WARNING(
"xAOD Pileup Truth Particles are already available in the event");
54 return StatusCode::SUCCESS;
60 CHECK( evtStore()->record( xTruthPileupParticleContainer, m_xaodTruthPileupParticleContainerName ) );
62 CHECK( evtStore()->record( xTruthPileupParticleAuxContainer, m_xaodTruthPileupParticleContainerName +
"Aux." ) );
63 xTruthPileupParticleContainer->setStore( xTruthPileupParticleAuxContainer );
64 ATH_MSG_DEBUG(
"Recorded TruthPileupParticleContainer with key: " << m_xaodTruthPileupParticleContainerName );
68 if (evtStore()->
retrieve(xTruthParticleContainer, m_xaodTruthParticleContainerName).isFailure()) {
69 ATH_MSG_ERROR(
"No TruthParticle collection with name " << m_xaodTruthParticleContainerName <<
" found in StoreGate!");
70 return StatusCode::FAILURE;
90 float this_abseta = theParticle->abseta();
91 float this_pt = theParticle->pt();
95 && (this_abseta < m_abseta_selection) ){
98 xTruthPileupParticleContainer->
push_back( xTruthParticle );
101 *xTruthParticle=*theParticle;
103 unsigned int particleOutCome;
106 unsigned int particleOrigin;
110 originDecorator(*xTruthParticle) = particleOrigin;
111 outcomeDecorator(*xTruthParticle) = particleOutCome;
113 classificationDecorator(*xTruthParticle) =
result;
114 parenthadronPIDDecorator(*xTruthParticle) = hadron_pdg;
119 return StatusCode::SUCCESS;