hepmc - Diff between revs 35 and 63
Subversion Repositories:
| Rev 35 | Rev 63 | |||
|---|---|---|---|---|
| Line 59... | Line 59... | |||
| 59 | //........................................HepMC INITIALIZATIONS | 59 | //........................................HepMC INITIALIZATIONS | |
| 60 | // | 60 | // | |
| 61 | // Instantiate an IO strategy for reading from HEPEVT. | 61 | // Instantiate an IO strategy for reading from HEPEVT. | |
| 62 | HepMC::IO_HEPEVT hepevtio; | 62 | HepMC::IO_HEPEVT hepevtio; | |
| 63 | // | 63 | // | |
| 64 | // Instantial an IO strategy to write the data to file - it uses the | - | ||
| 65 | // same ParticleDataTable | - | ||
| 66 | HepMC::IO_AsciiParticles ascii_io("example_PythiaParticle.dat",std::ios::out); | - | ||
| 67 | // | - | ||
| 68 | //........................................EVENT LOOP | - | ||
| 69 | for ( int i = 1; i <= 100; i++ ) { | - | ||
| 70 | if ( i%50==1 ) std::cout << "Processing Event Number " | - | ||
| 71 | << i << std::endl; | - | ||
| 72 | call_pyevnt(); // generate one event with Pythia | - | ||
| 73 | // pythia pyhepc routine converts common PYJETS in common HEPEVT | - | ||
| 74 | call_pyhepc( 1 ); | - | ||
| 75 | HepMC::GenEvent* evt = hepevtio.read_next_event(); | - | ||
| 76 | // add some information to the event | - | ||
| 77 | evt->set_event_number(i); | - | ||
| 78 | evt->set_signal_process_id(20); | - | ||
| 79 | // write the event out to the ascii file | - | ||
| 80 | ascii_io << evt; | - | ||
| 81 | // we also need to delete the created event from memory | - | ||
| 82 | delete evt; | - | ||
| 83 | } | - | ||
| 84 | //........................................TERMINATION | - | ||
| 85 | // write out some information from Pythia to the screen | - | ||
| 86 | call_pystat( 1 ); | - | ||
| - | 64 | { // begin scope of ascii_io | ||
| - | 65 | // Instantiate an IO strategy to write the data to file | ||
| - | 66 | HepMC::IO_AsciiParticles ascii_io("example_PythiaParticle.dat",std::ios::out); | ||
| - | 67 | // | ||
| - | 68 | //........................................EVENT LOOP | ||
| - | 69 | for ( int i = 1; i <= 100; i++ ) { | ||
| - | 70 | if ( i%50==1 ) std::cout << "Processing Event Number " | ||
| - | 71 | << i << std::endl; | ||
| - | 72 | call_pyevnt(); // generate one event with Pythia | ||
| - | 73 | // pythia pyhepc routine converts common PYJETS in common HEPEVT | ||
| - | 74 | call_pyhepc( 1 ); | ||
| - | 75 | HepMC::GenEvent* evt = hepevtio.read_next_event(); | ||
| - | 76 | // add some information to the event | ||
| - | 77 | evt->set_event_number(i); | ||
| - | 78 | evt->set_signal_process_id(20); | ||
| - | 79 | // write the event out to the ascii file | ||
| - | 80 | ascii_io << evt; | ||
| - | 81 | // we also need to delete the created event from memory | ||
| - | 82 | delete evt; | ||
| - | 83 | } | ||
| - | 84 | //........................................TERMINATION | ||
| - | 85 | // write out some information from Pythia to the screen | ||
| - | 86 | call_pystat( 1 ); | ||
| - | 87 | } // end scope of ascii_io | ||
| 87 | 88 | |||
| 88 | return 0; | 89 | return 0; | |
| 89 | } | 90 | } | |
| 90 | 91 | |||
| 91 | 92 | |||
