10 #include "Pythia8/LHEF3.h"
23 const XMLTag::pos_t XMLTag::end = string::npos;
33 LHAweights::LHAweights(
const XMLTag & tag) {
34 for ( map<string,string>::const_iterator it = tag.attr.begin();
35 it != tag.attr.end(); ++it ) {
36 string v = it->second.c_str();
40 contents = tag.contents;
42 istringstream iss(tag.contents);
44 while ( iss >> w ) weights.push_back(w);
51 void LHAweights::list(ostream & file)
const {
53 for ( map<string,string>::const_iterator it =
attributes.begin();
55 file <<
" " << it->first <<
"=\"" << it->second <<
"\"";
57 for (
int j = 0, M = weights.size(); j < M; ++j ) file <<
" " << weights[j];
58 file <<
"</weights>" << endl;
69 LHAscales::LHAscales(
const XMLTag & tag,
double defscale)
70 : muf(defscale), mur(defscale), mups(defscale), SCALUP(defscale) {
71 for ( map<string,string>::const_iterator it = tag.attr.begin();
72 it != tag.attr.end(); ++it ) {
73 double v = atof(it->second.c_str());
74 if ( it->first ==
"muf" ) muf = v;
75 else if ( it->first ==
"mur" ) mur = v;
76 else if ( it->first ==
"mups" ) mups = v;
77 else attributes.insert(make_pair(it->first, v));
79 contents = tag.contents;
86 void LHAscales::list(ostream & file)
const {
88 file <<
" muf=\"" << muf <<
"\"";
89 file <<
" mur=\"" << mur <<
"\"";
90 file <<
" mups=\"" << mups <<
"\"";
91 for ( map<string,double>::const_iterator it =
attributes.begin();
93 file <<
" " << it->first <<
"=\"" << it->second <<
"\"";
94 file <<
">" << contents;
95 file <<
"</scales>" << endl;
106 LHAgenerator::LHAgenerator(
const XMLTag & tag,
string defname)
107 : name(defname),
version(defname), contents(defname) {
108 for ( map<string,string>::const_iterator it = tag.attr.begin();
109 it != tag.attr.end(); ++it ) {
110 if ( it->first ==
"name" ) name = it->second;
111 else if ( it->first ==
"version" )
version = it->second;
112 else attributes.insert(make_pair(it->first, it->second));
114 contents = tag.contents;
121 void LHAgenerator::list(ostream & file)
const {
122 file <<
"<generator";
123 if ( name !=
"" ) file <<
" name=\"" << name <<
"\"";
124 if ( version !=
"" ) file <<
" version=\"" << version <<
"\"";
125 for ( map<string,string>::const_iterator it =
attributes.begin();
127 file <<
" " << it->first <<
"=\"" << it->second <<
"\"";
130 file <<
"</generator>" << endl;
141 LHAwgt::LHAwgt(
const XMLTag & tag,
double defwgt)
142 : id(
""), contents(defwgt) {
143 for ( map<string,string>::const_iterator it = tag.attr.begin();
144 it != tag.attr.end(); ++it ) {
145 if ( it->first ==
"id" )
id = it->second;
146 else attributes.insert(make_pair(it->first, it->second));
148 contents = atof(tag.contents.c_str());
155 void LHAwgt::list(ostream & file)
const {
157 if (
id !=
"" ) file <<
" id=\"" <<
id <<
"\"";
158 for ( map<string,string>::const_iterator it =
attributes.begin();
160 file <<
" " << it->first <<
"=\"" << it->second <<
"\"";
163 file <<
"</wgt>" << endl;
174 LHAweight::LHAweight(
const XMLTag & tag,
string defname)
175 : id(defname), contents(defname) {
176 for ( map<string,string>::const_iterator it = tag.attr.begin();
177 it != tag.attr.end(); ++it ) {
178 if ( it->first ==
"id" )
id = it->second;
179 else attributes.insert(make_pair(it->first, it->second));
181 contents = tag.contents;
188 void LHAweight::list(ostream & file)
const {
190 if (
id !=
"" ) file <<
" id=\"" <<
id <<
"\"";
191 for ( map<string,string>::const_iterator it =
attributes.begin();
193 file <<
" " << it->first <<
"=\"" << it->second <<
"\"";
196 file <<
"</weight>" << endl;
209 LHAweightgroup::LHAweightgroup(
const XMLTag & tag) {
211 for ( map<string,string>::const_iterator it = tag.attr.begin();
212 it != tag.attr.end(); ++it ) {
213 if ( it->first ==
"name" ) name = it->second;
214 else attributes.insert(make_pair(it->first,it->second));
223 contents = tag.contents;
227 vector<XMLTag*> tags = XMLTag::findXMLTags(tag.contents, &s);
228 for (
int i = 0, N = tags.size(); i < N; ++i ) {
229 const XMLTag & tagnow = *tags[i];
230 LHAweight wt(tagnow);
231 weights.insert(make_pair(wt.id, wt));
232 weightsKeys.push_back(wt.id);
234 for (
int i = 0, N = tag.tags.size(); i < N; ++i ) {
235 const XMLTag & tagnow = *tag.tags[i];
236 const LHAweight & wt(tagnow);
237 weights.insert(make_pair(wt.id, wt));
238 weightsKeys.push_back(wt.id);
241 for (
int i = 0, N = tags.size(); i < N; ++i )
if (tags[i])
delete tags[i];
249 void LHAweightgroup::list(ostream & file)
const {
250 file <<
"<weightgroup";
251 if ( name !=
"" ) file <<
" name=\"" << name <<
"\"";
252 for ( map<string,string>::const_iterator it =
attributes.begin();
254 file <<
" " << it->first <<
"=\"" << it->second <<
"\"";
256 for ( map<string,LHAweight>::const_iterator it = weights.begin();
257 it != weights.end(); ++it ) it->second.list(file);
258 file <<
"</weightgroup>" << endl;
270 LHArwgt::LHArwgt(
const XMLTag & tag) {
272 for ( map<string,string>::const_iterator it = tag.attr.begin();
273 it != tag.attr.end(); ++it ) {
274 string v = it->second.c_str();
277 contents = tag.contents;
281 vector<XMLTag*> tags = XMLTag::findXMLTags(tag.contents, &s);
282 for (
int i = 0, N = tags.size(); i < N; ++i ) {
283 const XMLTag & tagnow = *tags[i];
285 wgts.insert(make_pair(wt.id, wt));
286 wgtsKeys.push_back(wt.id);
288 for (
int i = 0, N = tag.tags.size(); i < N; ++i ) {
289 const XMLTag & tagnow = *tag.tags[i];
291 wgts.insert(make_pair(wt.id, wt));
292 wgtsKeys.push_back(wt.id);
295 for (
int i = 0, N = tags.size(); i < N; ++i )
if (tags[i])
delete tags[i];
303 void LHArwgt::list(ostream & file)
const {
305 for ( map<string,string>::const_iterator it =
attributes.begin();
307 file <<
" " << it->first <<
"=\"" << it->second <<
"\"";
309 for ( map<string,LHAwgt>::const_iterator it = wgts.begin();
310 it != wgts.end(); ++it ) it->second.list(file);
311 file <<
"</rwgt>" << endl;
323 LHAinitrwgt::LHAinitrwgt(
const XMLTag & tag) {
324 for ( map<string,string>::const_iterator it = tag.attr.begin();
325 it != tag.attr.end(); ++it ) {
326 string v = it->second.c_str();
329 contents = tag.contents;
333 vector<XMLTag*> tags = XMLTag::findXMLTags(tag.contents, &s);
334 for (
int i = 0, N = tags.size(); i < N; ++i ) {
335 const XMLTag & tagnow = *tags[i];
336 if ( tagnow.name ==
"weightgroup" ) {
337 LHAweightgroup wgroup(tagnow);
338 string wgname = wgroup.name;
345 weightgroups.insert(make_pair(wgname, wgroup));
346 weightgroupsKeys.push_back(wgname);
348 vector<XMLTag*> tags2 = XMLTag::findXMLTags(tagnow.contents, &ss);
349 for (
int k = 0, M = tags2.size(); k < M; ++k ) {
350 const XMLTag & tagnow2 = *tags2[k];
351 if ( tagnow2.name ==
"weight" ) {
352 LHAweight wt(tagnow2);
353 string wtname = wt.id;
354 weights.insert(make_pair(wtname, wt));
355 weightsKeys.push_back(wtname);
358 for (
int j = 0, M = tags2.size(); j < M; ++j )
359 if (tags2[j])
delete tags2[j];
360 }
else if ( tagnow.name ==
"weight" ) {
361 LHAweight wt(tagnow);
362 string wtname = wt.id;
363 weights.insert(make_pair(wtname, wt));
364 weightsKeys.push_back(wtname);
369 for (
int i = 0, N = tag.tags.size(); i < N; ++i ) {
370 const XMLTag & tagnow = *tag.tags[i];
371 if ( tagnow.name ==
"weightgroup" ) {
372 LHAweightgroup wgroup(tagnow);
373 string wgname = wgroup.name;
374 weightgroups.insert(make_pair(wgname, wgroup));
375 weightgroupsKeys.push_back(wgname);
377 vector<XMLTag*> tags2 = XMLTag::findXMLTags(tagnow.contents, &ss);
378 for (
int k = 0, M = tags2.size(); k < M; ++k ) {
379 const XMLTag & tagnow2 = *tags2[k];
380 if ( tagnow2.name ==
"weight" ) {
381 LHAweight wt(tagnow2);
382 string wtname = wt.id;
383 weights.insert(make_pair(wtname, wt));
384 weightsKeys.push_back(wtname);
387 for (
int k = 0, M = tagnow.tags.size(); k < M; ++k ) {
388 const XMLTag & tagnow2 = *tagnow.tags[k];
389 if ( tagnow2.name ==
"weight" ) {
390 LHAweight wt(tagnow2);
391 string wtname = wt.id;
392 weights.insert(make_pair(wtname, wt));
393 weightsKeys.push_back(wtname);
396 for (
int j = 0, M = tags2.size(); j < M; ++j )
397 if (tags2[j])
delete tags2[j];
398 }
else if ( tagnow.name ==
"weight" ) {
399 LHAweight wt(tagnow);
400 string wtname = wt.id;
401 weights.insert(make_pair(wtname, wt));
402 weightsKeys.push_back(wtname);
406 for (
int i = 0, N = tags.size(); i < N; ++i )
if (tags[i])
delete tags[i];
414 void LHAinitrwgt::list(ostream & file)
const {
416 for ( map<string,string>::const_iterator it =
attributes.begin();
418 file <<
" " << it->first <<
"=\"" << it->second <<
"\"";
420 for ( map<string,LHAweightgroup>::const_iterator it = weightgroups.begin();
421 it != weightgroups.end(); ++it ) it->second.list(file);
422 for ( map<string,LHAweight>::const_iterator it = weights.begin();
423 it != weights.end(); ++it ) it->second.list(file);
424 file <<
"</initrwgt>" << endl;
431 void HEPRUP::clear() {
432 IDBMUP = make_pair(0,0);
433 EBMUP = make_pair(0,0);
434 PDFGUP = make_pair(0,0);
435 PDFSUP = make_pair(0,0);
443 generators.resize(0);
444 weightgroups.clear();
462 HEPEUP & HEPEUP::setEvent(
const HEPEUP & x) {
479 scalesSave = x.scalesSave;
480 weightsSave = x.weightsSave;
481 weights_detailed = x.weights_detailed;
482 weights_compressed = x.weights_compressed;
483 rwgtSave = x.rwgtSave;
493 void HEPEUP::reset() {
495 weights_detailed.clear();
496 weights_compressed.clear();
509 void HEPEUP::resize() {
514 PUP.resize(NUP, vector<double>(5));
537 bool Reader::init() {
539 bool readingHeader =
false;
540 bool readingInit =
false;
545 if ( currentLine.find(
"<LesHouchesEvents" ) == string::npos )
548 if ( currentLine.find(
"version=\"1" ) != string::npos )
550 else if ( currentLine.find(
"version=\"2" ) != string::npos )
552 else if ( currentLine.find(
"version=\"3" ) != string::npos )
567 while ( getLine() && currentLine.find(
"</init>") == string::npos ) {
568 if ( currentLine.find(
"<header") != string::npos ) {
572 readingHeader =
true;
573 headerBlock = currentLine +
"\n";
575 else if ( currentLine.find(
"<init>") != string::npos
576 || currentLine.find(
"<init ") != string::npos ) {
583 istringstream iss(currentLine);
584 if ( !( iss >> heprup.IDBMUP.first >> heprup.IDBMUP.second
585 >> heprup.EBMUP.first >> heprup.EBMUP.second
586 >> heprup.PDFGUP.first >> heprup.PDFGUP.second
587 >> heprup.PDFSUP.first >> heprup.PDFSUP.second
588 >> heprup.IDWTUP >> heprup.NPRUP ) ) {
594 for (
int i = 0; i < heprup.NPRUP; ++i ) {
596 istringstream isss(currentLine);
597 if ( !( isss >> heprup.XSECUP[i] >> heprup.XERRUP[i]
598 >> heprup.XMAXUP[i] >> heprup.LPRUP[i] ) ) {
604 else if ( currentLine.find(
"</header>") != string::npos ) {
607 readingHeader =
false;
608 headerBlock += currentLine +
"\n";
610 else if ( readingHeader ) {
613 headerBlock += currentLine +
"\n";
614 headerComments += currentLine +
"\n";
616 else if ( readingInit ) {
618 initComments += currentLine +
"\n";
622 outsideBlock += currentLine +
"\n";
626 if ( file == NULL ) heprup.NPRUP = -42;
630 vector<XMLTag*> tags1 = XMLTag::findXMLTags(headerComments, &leftovers);
631 if ( leftovers.find_first_not_of(
" \t\n") == string::npos )
634 for (
int i = 0, N = tags1.size(); i < N; ++i ) {
635 const XMLTag & tag = *tags1[i];
637 if ( tag.name ==
"initrwgt" ) {
638 LHAinitrwgt irwgt(tag);
639 heprup.initrwgt = irwgt;
640 for (
int j = 0, M = tag.tags.size(); j < M; ++j ) {
641 XMLTag & ctag = *tag.tags[j];
642 if ( ctag.name ==
"weightgroup" ) {
643 LHAweightgroup wgroup(ctag);
644 string wgname = wgroup.name;
645 heprup.weightgroups.insert(make_pair(wgname, wgroup));
648 vector<XMLTag*> tags2 = XMLTag::findXMLTags(ctag.contents, &ss);
649 for (
int k = 0, O = tags2.size(); k < O; ++k ) {
650 const XMLTag & tagnow2 = *tags2[k];
651 if ( tagnow2.name ==
"weight" ) {
652 LHAweight wt(tagnow2);
653 string wtname = wt.id;
654 heprup.weights.insert(make_pair(wtname, wt));
657 for (
int k = 0, O = ctag.tags.size(); k < O; ++k ) {
658 const XMLTag & tagnow2 = *ctag.tags[k];
659 if ( tagnow2.name ==
"weight" ) {
660 LHAweight wt(tagnow2);
661 string wtname = wt.id;
662 heprup.weights.insert(make_pair(wtname, wt));
665 }
else if ( ctag.name ==
"weight" ) {
666 string tname = ctag.attr[
"id"];
667 heprup.weights.insert(make_pair(tname, LHAweight(ctag)));
673 heprup.generators.clear();
676 vector<XMLTag*> tags2 = XMLTag::findXMLTags(initComments, &leftovers);
677 if ( leftovers.find_first_not_of(
" \t\n") == string::npos )
680 for (
int i = 0, N = tags2.size(); i < N; ++i ) {
681 const XMLTag & tag = *tags2[i];
682 if ( tag.name ==
"generator" ) {
683 heprup.generators.push_back(LHAgenerator(tag));
687 for (
int i = 0, N = tags1.size(); i < N; ++i )
688 if (tags1[i])
delete tags1[i];
689 for (
int i = 0, N = tags2.size(); i < N; ++i )
690 if (tags2[i])
delete tags2[i];
703 bool Reader::readEvent(HEPEUP * peup) {
705 HEPEUP & eup = (peup? *peup: hepeup);
707 eup.heprup = &heprup;
708 weights_detailed_vec.clear();
712 if ( heprup.NPRUP < 0 )
return false;
720 while ( getLine() && currentLine.find(
"<event") == string::npos )
721 outsideBlock += currentLine +
"\n";
724 if (currentLine !=
"") {
725 string eventLine(currentLine);
726 eventLine +=
"</event>";
727 vector<XMLTag*> evtags = XMLTag::findXMLTags(eventLine);
728 XMLTag & evtag = *evtags[0];
729 for ( map<string,string>::const_iterator it = evtag.attr.begin();
730 it != evtag.attr.end(); ++it ) {
731 eup.attributes.insert(make_pair(it->first,it->second));
733 for (
int i = 0, N = evtags.size(); i < N; ++i )
734 if (evtags[i])
delete evtags[i];
737 if ( !getLine() )
return false;
741 istringstream iss(currentLine);
742 if ( !( iss >> eup.NUP >> eup.IDPRUP >> eup.XWGTUP
743 >> eup.SCALUP >> eup.AQEDUP >> eup.AQCDUP ) )
748 for (
int i = 0; i < eup.NUP; ++i ) {
749 if ( !getLine() )
return false;
750 istringstream isss(currentLine);
751 if ( !( isss >> eup.IDUP[i] >> eup.ISTUP[i]
752 >> eup.MOTHUP[i].first >> eup.MOTHUP[i].second
753 >> eup.ICOLUP[i].first >> eup.ICOLUP[i].second
754 >> eup.PUP[i][0] >> eup.PUP[i][1] >> eup.PUP[i][2]
755 >> eup.PUP[i][3] >> eup.PUP[i][4]
756 >> eup.VTIMUP[i] >> eup.SPINUP[i] ) )
761 while ( getLine() && currentLine.find(
"</event>") == string::npos )
762 eventComments += currentLine +
"\n";
764 if ( file == NULL )
return false;
766 eup.scalesSave = LHAscales(eup.SCALUP);
770 vector<XMLTag*> tags = XMLTag::findXMLTags(eventComments, &leftovers);
771 if ( leftovers.find_first_not_of(
" \t\n") == string::npos )
775 istringstream f(leftovers);
777 while (getline(f, l)) {
778 size_t p = l.find_first_not_of(
" \t");
780 p = l.find_last_not_of(
" \t");
781 if (string::npos != p) l.erase(p+1);
782 if (l.find_last_not_of(
"\n") != string::npos)
783 eventComments += l +
"\n";
786 for (
int i = 0, N = tags.size(); i < N; ++i ) {
787 XMLTag & tag = *tags[i];
789 if ( tag.name ==
"weights" ) {
791 eup.weightsSave = wts;
793 for (
int k = 0, M =
int(wts.weights.size()); k < M; ++k ) {
794 eup.weights_compressed.push_back(wts.weights[k]);
798 else if ( tag.name ==
"scales" ) {
799 eup.scalesSave = LHAscales(tag, eup.SCALUP);
801 else if ( tag.name ==
"rwgt" ) {
803 eup.rwgtSave = rwgt0;
805 vector<XMLTag*> tags2 = XMLTag::findXMLTags(rwgt0.contents, &s);
806 for (
int k = 0, M = tags2.size(); k < M; ++k ) {
807 const XMLTag & tagnow = *tags2[k];
808 if ( tagnow.name ==
"wgt" ) {
810 eup.weights_detailed.insert(make_pair(wt.id, wt.contents));
811 weights_detailed_vec.push_back(wt.contents);
814 for (
int k = 0, M = tag.tags.size(); k < M; ++k ) {
815 const XMLTag & tagnow = *tag.tags[k];
816 if ( tagnow.name ==
"wgt" ) {
818 eup.weights_detailed.insert(make_pair(wt.id, wt.contents));
819 weights_detailed_vec.push_back(wt.contents);
825 for (
int i = 0, N = tags.size(); i < N; ++i )
if (tags[i])
delete tags[i];
841 void Writer::init() {
845 file <<
"<LesHouchesEvents version=\"1.0\">" << endl;
847 file <<
"<LesHouchesEvents version=\"3.0\">" << endl;
849 file << setprecision(8);
852 file <<
"<header>" << endl;
853 file << hashline(headerStream.str(),
true) << std::flush;
854 if ( version != 1 ) heprup.initrwgt.list(file);
855 file <<
"</header>" << endl;
857 file <<
"<init>"<< endl
858 <<
" " << setw(8) << heprup.IDBMUP.first
859 <<
" " << setw(8) << heprup.IDBMUP.second
860 <<
" " << setw(14) << heprup.EBMUP.first
861 <<
" " << setw(14) << heprup.EBMUP.second
862 <<
" " << setw(4) << heprup.PDFGUP.first
863 <<
" " << setw(4) << heprup.PDFGUP.second
864 <<
" " << setw(4) << heprup.PDFSUP.first
865 <<
" " << setw(4) << heprup.PDFSUP.second
866 <<
" " << setw(4) << heprup.IDWTUP
867 <<
" " << setw(4) << heprup.NPRUP << endl;
869 for (
int i = 0; i < heprup.NPRUP; ++i )
870 file <<
" " << setw(14) << heprup.XSECUP[i]
871 <<
" " << setw(14) << heprup.XERRUP[i]
872 <<
" " << setw(14) << heprup.XMAXUP[i]
873 <<
" " << setw(6) << heprup.LPRUP[i] << endl;
875 if ( version == 1 ) {
876 file << hashline(initStream.str(),
true) << std::flush
877 <<
"</init>" << endl;
882 for (
int i = 0, N = heprup.generators.size(); i < N; ++i ) {
883 heprup.generators[i].list(file);
886 file << hashline(initStream.str(),
true) << std::flush
887 <<
"</init>" << endl;
896 bool Writer::writeEvent(HEPEUP * peup,
int pDigits) {
898 HEPEUP & eup = (peup? *peup: hepeup);
901 for ( map<string,string>::const_iterator it = eup.attributes.begin();
902 it != eup.attributes.end(); ++it )
903 file <<
" " << it->first <<
"=\"" << it->second <<
"\"";
904 file <<
">" << std::flush << endl;
905 file <<
" " << setw(4) << eup.NUP
906 <<
" " << setw(6) << eup.IDPRUP
907 <<
" " << setw(14) << eup.XWGTUP
908 <<
" " << setw(14) << eup.SCALUP
909 <<
" " << setw(14) << eup.AQEDUP
910 <<
" " << setw(14) << eup.AQCDUP << endl;
913 for (
int i = 0; i < eup.NUP; ++i )
914 file <<
" " << setw(8) << eup.IDUP[i]
915 <<
" " << setw(2) << eup.ISTUP[i]
916 <<
" " << setw(4) << eup.MOTHUP[i].first
917 <<
" " << setw(4) << eup.MOTHUP[i].second
918 <<
" " << setw(4) << eup.ICOLUP[i].first
919 <<
" " << setw(4) << eup.ICOLUP[i].second
920 <<
" " << setw(pDigits) << eup.PUP[i][0]
921 <<
" " << setw(pDigits) << eup.PUP[i][1]
922 <<
" " << setw(pDigits) << eup.PUP[i][2]
923 <<
" " << setw(pDigits) << eup.PUP[i][3]
924 <<
" " << setw(pDigits) << eup.PUP[i][4]
925 <<
" " << setw(1) << eup.VTIMUP[i]
926 <<
" " << setw(1) << eup.SPINUP[i] << endl;
929 file << hashline(eventStream.str()) << std::flush;
932 if ( version != 1 ) {
933 eup.rwgtSave.list(file);
934 eup.weightsSave.list(file);
935 eup.scalesSave.list(file);
938 file <<
"</event>" << endl;
940 if ( !file )
return false;
950 string Writer::getEventString(HEPEUP * peup) {
952 HEPEUP & eup = (peup? *peup: hepeup);
957 for ( map<string,string>::const_iterator it = eup.attributes.begin();
958 it != eup.attributes.end(); ++it )
959 helper <<
" " << it->first <<
"=\"" << it->second <<
"\"";
960 helper <<
">" << std::flush << endl;
961 helper <<
" " << setw(4) << eup.NUP
962 <<
" " << setw(6) << eup.IDPRUP
963 <<
" " << setw(14) << eup.XWGTUP
964 <<
" " << setw(14) << eup.SCALUP
965 <<
" " << setw(14) << eup.AQEDUP
966 <<
" " << setw(14) << eup.AQCDUP << endl;
969 for (
int i = 0; i < eup.NUP; ++i ) {
970 helper <<
" " << setw(8) << eup.IDUP[i]
971 <<
" " << setw(2) << eup.ISTUP[i]
972 <<
" " << setw(4) << eup.MOTHUP[i].first
973 <<
" " << setw(4) << eup.MOTHUP[i].second
974 <<
" " << setw(6) << eup.ICOLUP[i].first
975 <<
" " << setw(6) << eup.ICOLUP[i].second
978 <<
" " << setw(22) << eup.PUP[i][0]
979 <<
" " << setw(22) << eup.PUP[i][1]
980 <<
" " << setw(22) << eup.PUP[i][2]
981 <<
" " << setw(22) << eup.PUP[i][3]
982 <<
" " << setw(22) << eup.PUP[i][4]
983 <<
" " << setw(6) << eup.VTIMUP[i]
984 <<
" " << setw(6) << eup.SPINUP[i] << endl;
988 helper << hashline(eventStream.str()) << std::flush;
991 if ( version != 1 ) {
992 eup.rwgtSave.list(helper);
993 eup.weightsSave.list(helper);
994 eup.scalesSave.list(helper);
997 helper <<
"</event>" << endl;
999 string helperString = helper.str();
1002 return helperString;
1011 string Writer::hashline(
string s,
bool comment) {
1013 istringstream is(s);
1015 while ( getline(is, ss) ) {
void version(std::ostream &os=std::cout)
print HepMC version