14 #include "HepMC/GenEvent.h" 15 #include "HepMC/ReaderAscii.h" 16 #include "HepMC/WriterAscii.h" 17 #include "HepMC/Print.h" 20 using namespace HepMC;
25 int main(
int argc,
char **argv) {
28 cout <<
"Usage: " << argv[0] <<
" <HepMC3_input_file> <output_file>" << endl;
35 int events_parsed = 0;
37 while(!input_file.failed()) {
41 input_file.read_event(evt);
44 if( input_file.failed() )
break;
47 output_file.write_event(evt);
49 if(events_parsed==0) {
50 cout <<
" First event: " << endl;
54 cout <<
" Testing attribute reading for the first event: " << endl;
56 shared_ptr<GenCrossSection> cs = evt.attribute<
GenCrossSection>(
"GenCrossSection");
57 shared_ptr<GenHeavyIon> hi = evt.attribute<
GenHeavyIon>(
"GenHeavyIon");
58 shared_ptr<GenPdfInfo> pi = evt.attribute<
GenPdfInfo>(
"GenPdfInfo");
61 cout <<
" Has GenCrossSection: ";
64 else cout <<
" No GenCrossSection " << endl;
67 cout <<
" Has GenPdfInfo: ";
70 else cout <<
" No GenPdfInfo " << endl;
73 cout <<
" Has GenHeavyIon: ";
76 else cout <<
" No GenHeavyIon " << endl;
80 if( events_parsed%100 == 0 ) cout<<
"Events parsed: "<<events_parsed<<endl;
Stores additional information about Heavy Ion generator.
Stores additional information about PDFs.
static void listing(const GenEvent &event, unsigned short precision=2)
Print event in listing (HepMC2) format.
Stores additional information about cross-section.
static void line(const GenEvent &event)
Print one-line info.
Stores event-related information.
GenEvent I/O serialization for structured text files.
static void content(const GenEvent &event)
Print content of all GenEvent containers.
int main(int argc, char **argv)
Definition of template class SmartPointer.
GenEvent I/O parsing for structured text files.