hepmc - Diff between revs 179 and 199
Subversion Repositories:
| Rev 179 | Rev 199 | |||
|---|---|---|---|---|
| Line 4... | Line 4... | |||
| 4 | ////////////////////////////////////////////////////////////////////////// | 4 | ////////////////////////////////////////////////////////////////////////// | |
| 5 | // To Compile: go to the HepMC directory and type: | 5 | // To Compile: go to the HepMC directory and type: | |
| 6 | // gmake examples/example_UsingIterators.exe | 6 | // gmake examples/example_UsingIterators.exe | |
| 7 | // | 7 | // | |
| 8 | 8 | |||
| 9 | #include "HepMC/IO_Ascii.h" | - | ||
| - | 9 | #include "HepMC/IO_GenEvent.h" | ||
| 10 | #include "HepMC/GenEvent.h" | 10 | #include "HepMC/GenEvent.h" | |
| 11 | #include <math.h> | 11 | #include <math.h> | |
| 12 | #include <algorithm> | 12 | #include <algorithm> | |
| 13 | #include <list> | 13 | #include <list> | |
| 14 | 14 | |||
| Line 54... | Line 54... | |||
| 54 | }; | 54 | }; | |
| 55 | 55 | |||
| 56 | int main() { | 56 | int main() { | |
| 57 | { // begin scope of ascii_in | 57 | { // begin scope of ascii_in | |
| 58 | // an event has been prepared in advance for this example, read it | 58 | // an event has been prepared in advance for this example, read it | |
| 59 | // into memory using the IO_Ascii input strategy | - | ||
| 60 | HepMC::IO_Ascii ascii_in("example_UsingIterators.txt",std::ios::in); | - | ||
| - | 59 | // into memory using the IO_GenEvent input strategy | ||
| - | 60 | HepMC::IO_GenEvent ascii_in("example_UsingIterators.txt",std::ios::in); | ||
| 61 | if ( ascii_in.rdstate() == std::ios::failbit ) { | 61 | if ( ascii_in.rdstate() == std::ios::failbit ) { | |
| 62 | std::cerr << "ERROR input file example_UsingIterators.txt is needed " | 62 | std::cerr << "ERROR input file example_UsingIterators.txt is needed " | |
| 63 | << "and does not exist. " | 63 | << "and does not exist. " | |
| 64 | << "\n Look for it in HepMC/examples, Exit." << std::endl; | 64 | << "\n Look for it in HepMC/examples, Exit." << std::endl; | |
| 65 | return 1; | 65 | return 1; | |
