HepMC3 event record library
IsGoodEvent.h
1 //////////////////////////////////////////////////////////////////////////
2 // IsGoodEvent.h
3 //
4 // garren@fnal.gov, May 2007
5 // andrii.verbytskyi@mpp.mpg.de, Nov 2018
6 //
7 //////////////////////////////////////////////////////////////////////////
8 
9 //! used in the tests
10 using namespace HepMC3;
11 /// \class IsGoodEvent
12 /// event selection predicate. returns true if the event contains
13 /// a photon with pT > 50 GeV
14 class IsGoodEvent {
15 public:
16  bool operator()( const GenEvent& evt ) {
17  for (ConstGenParticlePtr p: evt.particles())
18  if ( p->pdg_id() == 22 && p->momentum().perp() > 25. ) return 1;
19  return 0;
20  }
21 };
22 /// \class IsGoodEventDIS
23 /// event selection predicate. returns true if the event contains
24 /// an electron with E > 10 GeV
26 public:
27  bool operator()( const GenEvent& evt ) {
28  for (ConstGenParticlePtr p: evt.particles())
29  if ( p->status() == 1 && std::abs(p->pdg_id()) == 11 && p->momentum().e() > 10.) return 1;
30  return 0;
31  }
32 };
HepMC3 main namespace.
Definition: WriterDOT.h:19
Stores event-related information.
Definition: GenEvent.h:42
const std::vector< ConstGenParticlePtr > & particles() const
Get list of particles (const)
Definition: GenEvent.cc:40
Feature< Feature_type > abs(const Feature< Feature_type > &input)
Obtain the absolute value of a Feature. This works as you&#39;d expect. If foo is a valid Feature...
Definition: Feature.h:316