Skip to content
Snippets Groups Projects
Commit c589be1b authored by Frank Gaede's avatar Frank Gaede
Browse files

only set gentstat=- if particle created in simulationwq

parent d1a5da11
No related branches found
No related tags found
No related merge requests found
......@@ -190,6 +190,7 @@ lcio::LCCollectionVec* Geant4Output2LCIO::saveParticles(Geant4ParticleMap* parti
int id = (*i).first;
const Geant4ParticleHandle p = (*i).second;
PropertyMask mask(p->status);
// std::cout << " ********** mcp status : 0x" << std::hex << p->status << ", mask.isSet(G4PARTICLE_GEN_STABLE) x" << std::dec << mask.isSet(G4PARTICLE_GEN_STABLE) <<std::endl ;
const G4ParticleDefinition* def = p.definition();
MCParticleImpl* q = new lcio::MCParticleImpl();
q->setPDG(p->pdgID);
......@@ -212,6 +213,7 @@ lcio::LCCollectionVec* Geant4Output2LCIO::saveParticles(Geant4ParticleMap* parti
if ( mask.isSet(G4PARTICLE_GEN_STABLE) ) q->setGeneratorStatus(1);
else if ( mask.isSet(G4PARTICLE_GEN_DECAYED) ) q->setGeneratorStatus(2);
else if ( mask.isSet(G4PARTICLE_GEN_DOCUMENTATION) ) q->setGeneratorStatus(3);
// std::cout << " ********** mcp genstatus : " << q->getGeneratorStatus() << std::endl ;
// Set simulation status
q->setCreatedInSimulation( mask.isSet(G4PARTICLE_SIM_CREATED) );
......@@ -224,7 +226,7 @@ lcio::LCCollectionVec* Geant4Output2LCIO::saveParticles(Geant4ParticleMap* parti
q->setOverlay( false );
//fg: if simstatus !=0 we have to set the generator status to 0:
if( q->getSimulatorStatus() != 0 )
if( q->isCreatedInSimulation() )
q->setGeneratorStatus( 0 ) ;
q->setSpin(p->spin);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment