#include <GenParticleInfoExtractor.h>
Public Member Functions | |
const GenParticleInfo & | operator() (const G4PrimaryParticle *p) const |
Definition at line 8 of file GenParticleInfoExtractor.h.
const GenParticleInfo & GenParticleInfoExtractor::operator() | ( | const G4PrimaryParticle * | p | ) | const |
Definition at line 7 of file GenParticleInfoExtractor.cc.
{ G4VUserPrimaryParticleInformation * up = p->GetUserInformation(); if (up == 0) throw SimG4Exception ("GenParticleInfoExtractor: G4PrimaryParticle has no user information"); GenParticleInfo * gpi = dynamic_cast<GenParticleInfo *>(up); if (gpi == 0) throw SimG4Exception ("User information in G4PrimaryParticle is not of GenParticleInfo type"); return * gpi; }