![]() |
HepMC Reference DocumentationHepMC |
00001 // 00002 // Thanks to Bob McElrath and Frank Siegert for this test 00003 // 00004 00005 #include <fstream> 00006 00007 #include "HepMC/GenEvent.h" 00008 #include "HepMC/SimpleVector.h" 00009 00010 int main(int argc,char* argv[]) 00011 { 00012 HepMC::GenEvent* p_event; 00013 00014 p_event = new HepMC::GenEvent(); 00015 00016 // define an output stream 00017 std::ofstream os( "testPrintBug.out" ); 00018 00019 for(int i=0; i<10; i++) { 00020 HepMC::FourVector vector(1.0,1.0,1.0,1.0); 00021 HepMC::GenVertex* vertex = new HepMC::GenVertex(vector,i); 00022 for(int j=0; j<3; j++) { 00023 HepMC::GenParticle* particle = new HepMC::GenParticle(vector,1,2); 00024 vertex->add_particle_in(particle); 00025 } 00026 for(int j=0; j<3; j++) { 00027 HepMC::GenParticle* particle = new HepMC::GenParticle(vector,1,2); 00028 vertex->add_particle_out(particle); 00029 } 00030 p_event->add_vertex(vertex); 00031 } 00032 p_event->print(os); 00033 // cleanup 00034 delete p_event; 00035 return 0; 00036 }