#include "HepMC/GenParticle.h" #include namespace MyAnalysis { class is_photon { public: bool operator() ( const HepMC::GenParticle* p ) { if ( p && p->pdg_id() == 22 ) return 1; return 0; } }; }