22 const IInterface*
p ) :
28 m_particlesKey(
"TruthParticles"),
32 m_classifier(
"MCTruthClassifier/MCTruthClassifier"),
35 declareInterface<DerivationFramework::IAugmentationTool>(
this);
52 if (m_runClassifier)
ATH_CHECK(m_classifier.retrieve());
54 if (m_particlesKey==
"" ) {
55 ATH_MSG_FATAL(
"No truth particle collection provided to use as a basis for new collections");
56 return StatusCode::FAILURE;
57 }
else {
ATH_MSG_INFO(
"Using " << m_particlesKey <<
" as the source collections for new truth collections");}
59 if (m_collectionName==
"") {
60 ATH_MSG_FATAL(
"No key provided for the new truth particle collection");
61 return StatusCode::FAILURE;
62 }
else {
ATH_MSG_INFO(
"New truth particle collection key: " << m_collectionName );}
64 if (m_partString==
"") {
66 return StatusCode::FAILURE;
67 }
else {
ATH_MSG_INFO(
"Truth particle selection string: " << m_partString );}
70 if ( !m_partString.empty() ) {
71 ATH_CHECK( initializeParser(m_partString) );
73 return StatusCode::SUCCESS;
80 ATH_MSG_INFO(
"Processed "<< m_ntotpart <<
" truth particles, "<< m_npasspart <<
" were retained ");
82 return StatusCode::SUCCESS;
91 if (evtStore()->
retrieve(importedTruthParticles,m_particlesKey).isFailure()) {
92 ATH_MSG_ERROR(
"No TruthParticle collection with name " << m_particlesKey <<
" found in StoreGate!");
93 return StatusCode::FAILURE;
98 CHECK( evtStore()->record( newParticleCollection, m_collectionName ) );
100 CHECK( evtStore()->record( newParticleAuxCollection, m_collectionName +
"Aux." ) );
101 newParticleCollection->setStore( newParticleAuxCollection );
102 ATH_MSG_DEBUG(
"Recorded new TruthParticleContainer with key: " << m_collectionName);
105 unsigned int nParticles = importedTruthParticles->
size();
106 m_ntotpart += nParticles;
119 if (!m_partString.empty()) {
120 entries = m_parser->evaluateAsVector();
122 if (nParticles !=
entries.size() ) {
123 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string used TruthParticles?");
124 return StatusCode::FAILURE;
127 for (
unsigned int i=0;
i<nParticles; ++
i) {
142 if (parentPDGID==24 && parentMass < 20){
145 else if (parentPDGID!=24 && parentPDGID!=15){
148 else if (parentPDGID==15){
159 if (mcount > 10 || abs(mother_hold->
pdgId())!=24){
178 newParticleCollection->
push_back( xTruthParticle );
182 float mothermass = 0.;
186 motherPDGid = mother_hold->
pdgId();
187 mothermass = mother_hold->
p4().M()/1000.;
198 motherPDGid = mother_hold->
pdgId();
199 mothermass = mother_hold->
p4().M()/1000.;
203 *xTruthParticle=*theParticle;
205 originDecorator(*xTruthParticle) = motherPDGid;
206 typeDecorator(*xTruthParticle) = motherBarcode;
207 typeDecoratorMass(*xTruthParticle) = mothermass;
263 tauprongDecorator(*xTruthParticle) = nprong;
264 tautypeDecorator(*xTruthParticle) = islep;
271 for (
unsigned int i=0;
i<nParticles; ++
i){
275 return StatusCode::SUCCESS;