File: IsGoodEvent.h

package info (click to toggle)
hepmc3 3.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 14,116 kB
  • sloc: fortran: 66,849; cpp: 13,604; ansic: 1,374; xml: 109; sh: 72; makefile: 33
file content (34 lines) | stat: -rw-r--r-- 1,074 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//////////////////////////////////////////////////////////////////////////
// IsGoodEvent.h
//
// garren@fnal.gov, May 2007
// andrii.verbytskyi@mpp.mpg.de, Nov 2018
//
//////////////////////////////////////////////////////////////////////////

//! used in the tests
using namespace HepMC3;
/// \class  IsGoodEvent
/// event selection predicate. returns true if the event contains
/// a photon with pT > 50 GeV
class IsGoodEvent {
public:
    /// The main member
    bool operator()( const GenEvent& evt ) {
        for (ConstGenParticlePtr p: evt.particles())
            if ( p->pdg_id() == 22 && p->momentum().perp() > 25. ) return 1;
        return 0;
    }
};
/// \class  IsGoodEventDIS
/// event selection predicate. returns true if the event contains
/// an electron with E > 10 GeV
class IsGoodEventDIS {
public:
    /// The main member
    bool operator()( const GenEvent& evt ) {
        for (ConstGenParticlePtr p: evt.particles())
            if ( p->status() == 1 &&  std::abs(p->pdg_id()) == 11 && p->momentum().e() > 10.) return 1;
        return 0;
    }
};