hepmc - Diff between revs 103 and 107
Subversion Repositories:
| Rev 103 | Rev 107 | |||
|---|---|---|---|---|
| Line 20... | Line 20... | |||
| 20 | 20 | |||
| 21 | #include <iostream> | 21 | #include <iostream> | |
| 22 | #include "HepMC/PythiaWrapper.h" | 22 | #include "HepMC/PythiaWrapper.h" | |
| 23 | #include "HepMC/IO_HEPEVT.h" | 23 | #include "HepMC/IO_HEPEVT.h" | |
| 24 | #include "HepMC/IO_Ascii.h" | 24 | #include "HepMC/IO_Ascii.h" | |
| - | 25 | #include "HepMC/IO_ExtendedAscii.h" | ||
| 25 | #include "HepMC/GenEvent.h" | 26 | #include "HepMC/GenEvent.h" | |
| 26 | #include "PythiaHelper.h" | 27 | #include "PythiaHelper.h" | |
| 27 | 28 | |||
| 28 | int main() { | 29 | int main() { | |
| 29 | // | 30 | // | |
| Line 44... | Line 45... | |||
| 44 | HepMC::IO_HEPEVT hepevtio; | 45 | HepMC::IO_HEPEVT hepevtio; | |
| 45 | // | 46 | // | |
| 46 | { // begin scope of ascii_io | 47 | { // begin scope of ascii_io | |
| 47 | // Instantiate an IO strategy to write the data to file | 48 | // Instantiate an IO strategy to write the data to file | |
| 48 | HepMC::IO_Ascii ascii_io("example_MyPythia.dat",std::ios::out); | 49 | HepMC::IO_Ascii ascii_io("example_MyPythia.dat",std::ios::out); | |
| - | 50 | // declare an IO_ExtendedAscii for output | ||
| - | 51 | HepMC::IO_ExtendedAscii xout("example_MyPythia.exdat",std::ios::out); | ||
| 49 | // | 52 | // | |
| 50 | //........................................EVENT LOOP | 53 | //........................................EVENT LOOP | |
| 51 | for ( int i = 1; i <= 100; i++ ) { | 54 | for ( int i = 1; i <= 100; i++ ) { | |
| 52 | if ( i%50==1 ) std::cout << "Processing Event Number " | 55 | if ( i%50==1 ) std::cout << "Processing Event Number " | |
| 53 | << i << std::endl; | 56 | << i << std::endl; | |
| Line 58... | Line 61... | |||
| 58 | // add some information to the event | 61 | // add some information to the event | |
| 59 | evt->set_event_number(i); | 62 | evt->set_event_number(i); | |
| 60 | evt->set_signal_process_id(20); | 63 | evt->set_signal_process_id(20); | |
| 61 | // set number of multi parton interactions | 64 | // set number of multi parton interactions | |
| 62 | evt->set_mpi( pypars.msti[31-1] ); | 65 | evt->set_mpi( pypars.msti[31-1] ); | |
| 63 | // write the event out to the ascii file | - | ||
| - | 66 | // write the event out to the ascii files | ||
| 64 | ascii_io << evt; | 67 | ascii_io << evt; | |
| - | 68 | xout << evt; | ||
| 65 | // we also need to delete the created event from memory | 69 | // we also need to delete the created event from memory | |
| 66 | delete evt; | 70 | delete evt; | |
| 67 | } | 71 | } | |
| 68 | //........................................TERMINATION | 72 | //........................................TERMINATION | |
| 69 | // write out some information from Pythia to the screen | 73 | // write out some information from Pythia to the screen | |
