75 std::shared_ptr<Reader>
deduce_reader(std::istream & stream_test,std::istream & stream) {
76 std::vector<std::string> head;
77 head.push_back(std::string(
""));
78 head.push_back(std::string(
""));
81 while (getline(stream_test,head[goodcount])&&goodcount<1&&count<10) {
82 if (head[goodcount].length()) goodcount++;
85 if (count>10&&goodcount<2)
87 printf(
"Info in ReaderGZ::deduce_reader: The first %i lines in stream do not contain readable information\n",count);
88 return shared_ptr<Reader>(
nullptr);
90 printf(
"Info in ReaderGZ::deduce_reader: Attempt ReaderAscii for stream\n");
91 if( strncmp(head.at(0).c_str(),
"HepMC::Version",14) == 0 && strncmp(head.at(1).c_str(),
"HepMC::Asciiv3",14)==0 )
93 printf(
"Info in ReaderGZ::deduce_reader: Attempt ReaderAsciiHepMC2 for stream\n");
94 if( strncmp(head.at(0).c_str(),
"HepMC::Version",14) == 0 && strncmp(head.at(1).c_str(),
"HepMC::IO_GenEvent",18)==0 )
96 printf(
"Info in deduce_reader: Attempt ReaderLHEF for stream\n");
97 if( strncmp(head.at(0).c_str(),
"<LesHouchesEvents",17) == 0)
99 printf(
"Info in deduce_reader: Attempt ReaderHEPEVT for stream\n");
100 std::stringstream st_e(head.at(0).c_str());
110 if (attr==
' ')
continue;
115 HEPEVT=
static_cast<bool>(st_e>>m_i>>m_p);
119 printf(
"Info in deduce_reader: All attempts failed for stream\n");
120 return shared_ptr<Reader>(
nullptr);