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  /// The main member
17  bool operator()( const GenEvent& evt ) {
18  for (ConstGenParticlePtr p: evt.particles())
19  if ( p->pdg_id() == 22 && p->momentum().perp() > 25. ) return 1;
20  return 0;
21  }
22 };
23 /// \class IsGoodEventDIS
24 /// event selection predicate. returns true if the event contains
25 /// an electron with E > 10 GeV
27 public:
28  /// The main member
29  bool operator()( const GenEvent& evt ) {
30  for (ConstGenParticlePtr p: evt.particles())
31  if ( p->status() == 1 && std::abs(p->pdg_id()) == 11 && p->momentum().e() > 10.) return 1;
32  return 0;
33  }
34 };
Stores event-related information.
Definition: GenEvent.h:41
bool operator()(const GenEvent &evt)
The main member.
Definition: IsGoodEvent.h:29
bool operator()(const GenEvent &evt)
The main member.
Definition: IsGoodEvent.h:17
const std::vector< ConstGenParticlePtr > & particles() const
Get list of particles (const)
Definition: GenEvent.cc:39
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