23int main(
int argc,
char **argv) {
26 cout <<
"Usage: " << argv[0] <<
" <HepMC3_input_file> <output_file>" << endl;
33 int events_parsed = 0;
35 while(!input_file.failed()) {
39 input_file.read_event(evt);
42 if( input_file.failed() )
break;
45 output_file.write_event(evt);
47 if(events_parsed==0) {
48 cout <<
" First event: " << endl;
52 cout <<
" Testing attribute reading for the first event: " << endl;
54 shared_ptr<GenCrossSection> cs = evt.attribute<
GenCrossSection>(
"GenCrossSection");
55 shared_ptr<GenHeavyIon> hi = evt.attribute<
GenHeavyIon>(
"GenHeavyIon");
56 shared_ptr<GenPdfInfo> pi = evt.attribute<
GenPdfInfo>(
"GenPdfInfo");
59 cout <<
" Has GenCrossSection: ";
62 else cout <<
" No GenCrossSection " << endl;
65 cout <<
" Has GenPdfInfo: ";
68 else cout <<
" No GenPdfInfo " << endl;
71 cout <<
" Has GenHeavyIon: ";
74 else cout <<
" No GenHeavyIon " << endl;
78 if( events_parsed%100 == 0 ) cout<<
"Events parsed: "<<events_parsed<<endl;
Definition of class GenEvent.
Definition of static class Print.
Definition of class ReaderAscii.
Definition of class WriterAscii.
Stores additional information about cross-section.
Stores event-related information.
Stores additional information about Heavy Ion generator.
Stores additional information about PDFs.
static void content(std::ostream &os, const GenEvent &event)
Print content of all GenEvent containers.
static void listing(std::ostream &os, const GenEvent &event, unsigned short precision=2)
Print event in listing (HepMC2) format.
static void line(std::ostream &os, const GenEvent &event, bool attributes=false)
Print one-line info.
GenEvent I/O parsing for structured text files.
GenEvent I/O serialization for structured text files.