hepmc - Diff between revs 117 and 128
Subversion Repositories:
| Rev 117 | Rev 128 | |||
|---|---|---|---|---|
| Line 4... | Line 4... | |||
| 4 | // garren@fnal.gov, March 2006 | 4 | // garren@fnal.gov, March 2006 | |
| 5 | // Use Matt's example_EventSelection to check HepMC. | - | ||
| 6 | // Apply an event selection to the events in testMass.input | - | ||
| 7 | // Events containing a photon of pT > 25 GeV pass the selection and are | - | ||
| 8 | // written to "testMass.dat" | - | ||
| 9 | // Add arbitrary PDF information to the good events | - | ||
| 10 | // Also write events using IO_AsciiParticles and IO_ExtendedAscii | - | ||
| - | 5 | // Read events written by example_MyPythia.cc | ||
| - | 6 | // Select events containing a photon of pT > 25 GeV | ||
| - | 7 | // Add arbitrary PDF information to one of the good events | ||
| - | 8 | // Write the selected events and read them back in | ||
| 11 | ////////////////////////////////////////////////////////////////////////// | 9 | ////////////////////////////////////////////////////////////////////////// | |
| 12 | // | 10 | // | |
| 13 | 11 | |||
| 14 | #include "HepMC/IO_ExtendedAscii.h" | - | ||
| - | 12 | #include "HepMC/IO_GenEvent.h" | ||
| 15 | #include "HepMC/GenEvent.h" | 13 | #include "HepMC/GenEvent.h" | |
| 16 | #include "HepMC/Version.h" | 14 | #include "HepMC/Version.h" | |
| 17 | 15 | |||
| 18 | // define methods and classes used by this test | 16 | // define methods and classes used by this test | |
| 19 | #include "IsGoodEvent.h" | 17 | #include "IsGoodEvent.h" | |
| Line 23... | Line 21... | |||
| 23 | int main() { | 21 | int main() { | |
| 24 | // read and process the input file | 22 | // read and process the input file | |
| 25 | { | 23 | { | |
| 26 | // declare an input strategy to read the data produced with the | 24 | // declare an input strategy to read the data produced with the | |
| 27 | // example_MyPythia | 25 | // example_MyPythia | |
| 28 | HepMC::IO_ExtendedAscii ascii_in("@srcdir@/testHepMCExtended.input",std::ios::in); | - | ||
| 29 | // declare another IO_ExtendedAscii for output | - | ||
| 30 | HepMC::IO_ExtendedAscii ascii_out("testHepMCExtended.dat",std::ios::out); | - | ||
| - | 26 | HepMC::IO_GenEvent ascii_in("@srcdir@/testIOGenEvent.input",std::ios::in); | ||
| - | 27 | // declare another IO_GenEvent for output | ||
| - | 28 | HepMC::IO_GenEvent ascii_out("testMass1.dat",std::ios::out); | ||
| 31 | // declare an instance of the event selection predicate | 29 | // declare an instance of the event selection predicate | |
| 32 | IsGoodEvent is_good_event; | 30 | IsGoodEvent is_good_event; | |
| 33 | // send version to standard output | 31 | // send version to standard output | |
| 34 | HepMC::version(); | 32 | HepMC::version(); | |
| 35 | //........................................EVENT LOOP | 33 | //........................................EVENT LOOP | |
| Line 64... | Line 62... | |||
| 64 | << " processed events passed the cuts. Finished." << std::endl; | 62 | << " processed events passed the cuts. Finished." << std::endl; | |
| 65 | } | 63 | } | |
| 66 | // now read the file we just created | 64 | // now read the file we just created | |
| 67 | { | 65 | { | |
| 68 | // declare an input strategy | 66 | // declare an input strategy | |
| 69 | HepMC::IO_ExtendedAscii xin("testHepMCExtended.dat",std::ios::in); | - | ||
| 70 | // declare another IO_ExtendedAscii for output | - | ||
| 71 | HepMC::IO_ExtendedAscii xout("testMass.dat",std::ios::out); | - | ||
| - | 67 | HepMC::IO_GenEvent xin("testMass1.dat",std::ios::in); | ||
| - | 68 | // declare another IO_GenEvent for output | ||
| - | 69 | HepMC::IO_GenEvent xout("testMass2.dat",std::ios::out); | ||
| 72 | //........................................EVENT LOOP | 70 | //........................................EVENT LOOP | |
| 73 | int ixin=0; | 71 | int ixin=0; | |
| 74 | HepMC::GenEvent* evt = xin.read_next_event(); | 72 | HepMC::GenEvent* evt = xin.read_next_event(); | |
| 75 | while ( evt ) { | 73 | while ( evt ) { | |
| 76 | ixin++; | 74 | ixin++; | |
