23int main(
int argc,
char **argv) {
26 std::cout <<
"Usage: " << argv[0] <<
" <HepMC3_input_file> <output_file>" << std::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 std::cout <<
" First event: " << std::endl;
52 std::cout <<
" Testing attribute reading for the first event: " << std::endl;
54 std::shared_ptr<GenCrossSection> cs = evt.attribute<
GenCrossSection>(
"GenCrossSection");
55 std::shared_ptr<GenHeavyIon> hi = evt.attribute<
GenHeavyIon>(
"GenHeavyIon");
56 std::shared_ptr<GenPdfInfo> pi = evt.attribute<
GenPdfInfo>(
"GenPdfInfo");
59 std::cout <<
" Has GenCrossSection: ";
62 else std::cout <<
" No GenCrossSection " << std::endl;
65 std::cout <<
" Has GenPdfInfo: ";
68 else std::cout <<
" No GenPdfInfo " << std::endl;
71 std::cout <<
" Has GenHeavyIon: ";
74 else std::cout <<
" No GenHeavyIon " << std::endl;
78 if( events_parsed%100 == 0 ) std::cout<<
"Events parsed: "<<events_parsed<<std::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.