Rev 63 | Rev 129 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 63 | Rev 65 | ||
|---|---|---|---|
| Line 10... | Line 10... | ||
| 10 | //
|
10 | //
|
| 11 | 11 | ||
| 12 | #include "HepMC/IO_Ascii.h"
|
12 | #include "HepMC/IO_Ascii.h"
|
| 13 | #include "HepMC/GenEvent.h"
|
13 | #include "HepMC/GenEvent.h"
|
| 14 | 14 | ||
| - | 15 | //! example class
|
|
| - | 16 | ||
| - | 17 | /// \class IsGoodEvent
|
|
| - | 18 | /// event selection predicate. returns true if the event contains
|
|
| - | 19 | /// a photon with pT > 50 GeV
|
|
| 15 | class IsGoodEvent { |
20 | class IsGoodEvent { |
| 16 | // event selection predicate. returns true if the event contains
|
- | |
| 17 | // a photon with pT > 50 GeV
|
- | |
| 18 | public: |
21 | public: |
| - | 22 | /// check this event for goodness
|
|
| 19 | bool operator()( const HepMC::GenEvent* evt ) { |
23 | bool operator()( const HepMC::GenEvent* evt ) { |
| 20 | for ( HepMC::GenEvent::particle_const_iterator p |
24 | for ( HepMC::GenEvent::particle_const_iterator p |
| 21 | = evt->particles_begin(); p != evt->particles_end(); ++p ){ |
25 | = evt->particles_begin(); p != evt->particles_end(); ++p ){ |
| 22 | if ( (*p)->pdg_id() == 22 && (*p)->momentum().perp() > 25. ) { |
26 | if ( (*p)->pdg_id() == 22 && (*p)->momentum().perp() > 25. ) { |
| 23 | //std::cout << "Event " << evt->event_number()
|
27 | //std::cout << "Event " << evt->event_number()
|