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
569 && currentLine.find(
"#") == string::npos) {
573 readingHeader =
true;
574 headerBlock = currentLine +
"\n";
576 else if ( ( currentLine.find(
"<init>") != string::npos
577 || currentLine.find(
"<init ") != string::npos )
578 && currentLine.find(
"#") == string::npos) {
585 istringstream iss(currentLine);
586 if ( !( iss >> heprup.IDBMUP.first >> heprup.IDBMUP.second
587 >> heprup.EBMUP.first >> heprup.EBMUP.second
588 >> heprup.PDFGUP.first >> heprup.PDFGUP.second
589 >> heprup.PDFSUP.first >> heprup.PDFSUP.second
590 >> heprup.IDWTUP >> heprup.NPRUP ) ) {
596 for (
int i = 0; i < heprup.NPRUP; ++i ) {
598 istringstream isss(currentLine);
599 if ( !( isss >> heprup.XSECUP[i] >> heprup.XERRUP[i]
600 >> heprup.XMAXUP[i] >> heprup.LPRUP[i] ) ) {
606 else if ( currentLine.find(
"</header>") != string::npos
607 && currentLine.find(
"#") == string::npos) {
610 readingHeader =
false;
611 headerBlock += currentLine +
"\n";
613 else if ( readingHeader ) {
616 headerBlock += currentLine +
"\n";
617 headerComments += currentLine +
"\n";
619 else if ( readingInit ) {
621 initComments += currentLine +
"\n";
625 outsideBlock += currentLine +
"\n";
629 if ( file == NULL ) heprup.NPRUP = -42;
633 vector<XMLTag*> tags1 = XMLTag::findXMLTags(headerComments, &leftovers);
634 if ( leftovers.find_first_not_of(
" \t\n") == string::npos )
637 for (
int i = 0, N = tags1.size(); i < N; ++i ) {
638 const XMLTag & tag = *tags1[i];
640 if ( tag.name ==
"initrwgt" ) {
641 LHAinitrwgt irwgt(tag);
642 heprup.initrwgt = irwgt;
643 for (
int j = 0, M = tag.tags.size(); j < M; ++j ) {
644 XMLTag & ctag = *tag.tags[j];
645 if ( ctag.name ==
"weightgroup" ) {
646 LHAweightgroup wgroup(ctag);
647 string wgname = wgroup.name;
648 heprup.weightgroups.insert(make_pair(wgname, wgroup));
651 vector<XMLTag*> tags2 = XMLTag::findXMLTags(ctag.contents, &ss);
652 for (
int k = 0, O = tags2.size(); k < O; ++k ) {
653 const XMLTag & tagnow2 = *tags2[k];
654 if ( tagnow2.name ==
"weight" ) {
655 LHAweight wt(tagnow2);
656 string wtname = wt.id;
657 heprup.weights.insert(make_pair(wtname, wt));
660 for (
int k = 0, O = ctag.tags.size(); k < O; ++k ) {
661 const XMLTag & tagnow2 = *ctag.tags[k];
662 if ( tagnow2.name ==
"weight" ) {
663 LHAweight wt(tagnow2);
664 string wtname = wt.id;
665 heprup.weights.insert(make_pair(wtname, wt));
668 }
else if ( ctag.name ==
"weight" ) {
669 string tname = ctag.attr[
"id"];
670 heprup.weights.insert(make_pair(tname, LHAweight(ctag)));
676 heprup.generators.clear();
679 vector<XMLTag*> tags2 = XMLTag::findXMLTags(initComments, &leftovers);
680 if ( leftovers.find_first_not_of(
" \t\n") == string::npos )
683 for (
int i = 0, N = tags2.size(); i < N; ++i ) {
684 const XMLTag & tag = *tags2[i];
685 if ( tag.name ==
"generator" ) {
686 heprup.generators.push_back(LHAgenerator(tag));
690 for (
int i = 0, N = tags1.size(); i < N; ++i )
691 if (tags1[i])
delete tags1[i];
692 for (
int i = 0, N = tags2.size(); i < N; ++i )
693 if (tags2[i])
delete tags2[i];
706 bool Reader::readEvent(HEPEUP * peup) {
708 HEPEUP & eup = (peup? *peup: hepeup);
710 eup.heprup = &heprup;
711 weights_detailed_vec.clear();
712 weightnames_detailed_vec.clear();
716 if ( heprup.NPRUP < 0 )
return false;
724 while ( getLine() && currentLine.find(
"<event") == string::npos )
725 outsideBlock += currentLine +
"\n";
728 if (currentLine !=
"") {
729 string eventLine(currentLine);
730 eventLine +=
"</event>";
731 vector<XMLTag*> evtags = XMLTag::findXMLTags(eventLine);
732 XMLTag & evtag = *evtags[0];
733 for ( map<string,string>::const_iterator it = evtag.attr.begin();
734 it != evtag.attr.end(); ++it ) {
735 eup.attributes.insert(make_pair(it->first,it->second));
737 for (
int i = 0, N = evtags.size(); i < N; ++i )
738 if (evtags[i])
delete evtags[i];
741 if ( !getLine() )
return false;
745 istringstream iss(currentLine);
746 if ( !( iss >> eup.NUP >> eup.IDPRUP >> eup.XWGTUP
747 >> eup.SCALUP >> eup.AQEDUP >> eup.AQCDUP ) )
752 for (
int i = 0; i < eup.NUP; ++i ) {
753 if ( !getLine() )
return false;
754 istringstream isss(currentLine);
755 if ( !( isss >> eup.IDUP[i] >> eup.ISTUP[i]
756 >> eup.MOTHUP[i].first >> eup.MOTHUP[i].second
757 >> eup.ICOLUP[i].first >> eup.ICOLUP[i].second
758 >> eup.PUP[i][0] >> eup.PUP[i][1] >> eup.PUP[i][2]
759 >> eup.PUP[i][3] >> eup.PUP[i][4]
760 >> eup.VTIMUP[i] >> eup.SPINUP[i] ) )
765 while ( getLine() && currentLine.find(
"</event>") == string::npos )
766 eventComments += currentLine +
"\n";
768 if ( file == NULL )
return false;
770 eup.scalesSave = LHAscales(eup.SCALUP);
774 vector<XMLTag*> tags = XMLTag::findXMLTags(eventComments, &leftovers);
775 if ( leftovers.find_first_not_of(
" \t\n") == string::npos )
779 istringstream f(leftovers);
781 while (getline(f, l)) {
782 size_t p = l.find_first_not_of(
" \t");
784 p = l.find_last_not_of(
" \t");
785 if (string::npos != p) l.erase(p+1);
786 if (l.find_last_not_of(
"\n") != string::npos)
787 eventComments += l +
"\n";
790 for (
int i = 0, N = tags.size(); i < N; ++i ) {
791 XMLTag & tag = *tags[i];
793 if ( tag.name ==
"weights" ) {
795 eup.weightsSave = wts;
797 for (
int k = 0, M =
int(wts.weights.size()); k < M; ++k ) {
798 eup.weights_compressed.push_back(wts.weights[k]);
802 else if ( tag.name ==
"scales" ) {
803 eup.scalesSave = LHAscales(tag, eup.SCALUP);
805 else if ( tag.name ==
"rwgt" ) {
807 eup.rwgtSave = rwgt0;
809 vector<XMLTag*> tags2 = XMLTag::findXMLTags(rwgt0.contents, &s);
810 for (
int k = 0, M = tags2.size(); k < M; ++k ) {
811 const XMLTag & tagnow = *tags2[k];
812 if ( tagnow.name ==
"wgt" ) {
814 eup.weights_detailed.insert(make_pair(wt.id, wt.contents));
815 weights_detailed_vec.push_back(wt.contents);
816 weightnames_detailed_vec.push_back(wt.id);
819 for (
int k = 0, M = tag.tags.size(); k < M; ++k ) {
820 const XMLTag & tagnow = *tag.tags[k];
821 if ( tagnow.name ==
"wgt" ) {
823 eup.weights_detailed.insert(make_pair(wt.id, wt.contents));
824 weights_detailed_vec.push_back(wt.contents);
825 weightnames_detailed_vec.push_back(wt.id);
831 for (
int i = 0, N = tags.size(); i < N; ++i )
if (tags[i])
delete tags[i];
847 void Writer::init() {
851 file <<
"<LesHouchesEvents version=\"1.0\">" << endl;
853 file <<
"<LesHouchesEvents version=\"3.0\">" << endl;
855 file << setprecision(8);
858 file <<
"<header>" << endl;
859 file << hashline(headerStream.str(),
true) << std::flush;
860 if ( version != 1 ) heprup.initrwgt.list(file);
861 file <<
"</header>" << endl;
863 file <<
"<init>"<< endl
864 <<
" " << setw(8) << heprup.IDBMUP.first
865 <<
" " << setw(8) << heprup.IDBMUP.second
866 <<
" " << setw(14) << heprup.EBMUP.first
867 <<
" " << setw(14) << heprup.EBMUP.second
868 <<
" " << setw(4) << heprup.PDFGUP.first
869 <<
" " << setw(4) << heprup.PDFGUP.second
870 <<
" " << setw(4) << heprup.PDFSUP.first
871 <<
" " << setw(4) << heprup.PDFSUP.second
872 <<
" " << setw(4) << heprup.IDWTUP
873 <<
" " << setw(4) << heprup.NPRUP << endl;
875 for (
int i = 0; i < heprup.NPRUP; ++i )
876 file <<
" " << setw(14) << heprup.XSECUP[i]
877 <<
" " << setw(14) << heprup.XERRUP[i]
878 <<
" " << setw(14) << heprup.XMAXUP[i]
879 <<
" " << setw(6) << heprup.LPRUP[i] << endl;
881 if ( version == 1 ) {
882 file << hashline(initStream.str(),
true) << std::flush
883 <<
"</init>" << endl;
888 for (
int i = 0, N = heprup.generators.size(); i < N; ++i ) {
889 heprup.generators[i].list(file);
892 file << hashline(initStream.str(),
true) << std::flush
893 <<
"</init>" << endl;
902 bool Writer::writeEvent(HEPEUP * peup,
int pDigits) {
904 HEPEUP & eup = (peup? *peup: hepeup);
907 for ( map<string,string>::const_iterator it = eup.attributes.begin();
908 it != eup.attributes.end(); ++it )
909 file <<
" " << it->first <<
"=\"" << it->second <<
"\"";
910 file <<
">" << std::flush << endl;
911 file <<
" " << setw(4) << eup.NUP
912 <<
" " << setw(6) << eup.IDPRUP
913 <<
" " << setw(14) << eup.XWGTUP
914 <<
" " << setw(14) << eup.SCALUP
915 <<
" " << setw(14) << eup.AQEDUP
916 <<
" " << setw(14) << eup.AQCDUP << endl;
919 for (
int i = 0; i < eup.NUP; ++i )
920 file <<
" " << setw(8) << eup.IDUP[i]
921 <<
" " << setw(2) << eup.ISTUP[i]
922 <<
" " << setw(4) << eup.MOTHUP[i].first
923 <<
" " << setw(4) << eup.MOTHUP[i].second
924 <<
" " << setw(4) << eup.ICOLUP[i].first
925 <<
" " << setw(4) << eup.ICOLUP[i].second
926 <<
" " << setw(pDigits) << eup.PUP[i][0]
927 <<
" " << setw(pDigits) << eup.PUP[i][1]
928 <<
" " << setw(pDigits) << eup.PUP[i][2]
929 <<
" " << setw(pDigits) << eup.PUP[i][3]
930 <<
" " << setw(pDigits) << eup.PUP[i][4]
931 <<
" " << setw(1) << eup.VTIMUP[i]
932 <<
" " << setw(1) << eup.SPINUP[i] << endl;
935 file << hashline(eventStream.str()) << std::flush;
938 if ( version != 1 ) {
939 eup.rwgtSave.list(file);
940 eup.weightsSave.list(file);
941 eup.scalesSave.list(file);
944 file <<
"</event>" << endl;
946 if ( !file )
return false;
956 string Writer::getEventString(HEPEUP * peup) {
958 HEPEUP & eup = (peup? *peup: hepeup);
963 for ( map<string,string>::const_iterator it = eup.attributes.begin();
964 it != eup.attributes.end(); ++it )
965 helper <<
" " << it->first <<
"=\"" << it->second <<
"\"";
966 helper <<
">" << std::flush << endl;
967 helper <<
" " << setw(4) << eup.NUP
968 <<
" " << setw(6) << eup.IDPRUP
969 <<
" " << setw(14) << eup.XWGTUP
970 <<
" " << setw(14) << eup.SCALUP
971 <<
" " << setw(14) << eup.AQEDUP
972 <<
" " << setw(14) << eup.AQCDUP << endl;
975 for (
int i = 0; i < eup.NUP; ++i ) {
976 helper <<
" " << setw(8) << eup.IDUP[i]
977 <<
" " << setw(2) << eup.ISTUP[i]
978 <<
" " << setw(4) << eup.MOTHUP[i].first
979 <<
" " << setw(4) << eup.MOTHUP[i].second
980 <<
" " << setw(6) << eup.ICOLUP[i].first
981 <<
" " << setw(6) << eup.ICOLUP[i].second
984 <<
" " << setw(22) << eup.PUP[i][0]
985 <<
" " << setw(22) << eup.PUP[i][1]
986 <<
" " << setw(22) << eup.PUP[i][2]
987 <<
" " << setw(22) << eup.PUP[i][3]
988 <<
" " << setw(22) << eup.PUP[i][4]
989 <<
" " << setw(6) << eup.VTIMUP[i]
990 <<
" " << setw(6) << eup.SPINUP[i] << endl;
994 helper << hashline(eventStream.str()) << std::flush;
997 if ( version != 1 ) {
998 eup.rwgtSave.list(helper);
999 eup.weightsSave.list(helper);
1000 eup.scalesSave.list(helper);
1003 helper <<
"</event>" << endl;
1005 string helperString = helper.str();
1008 return helperString;
1017 string Writer::hashline(
string s,
bool comment) {
1019 istringstream is(s);
1021 while ( getline(is, ss) ) {
void version(std::ostream &os=std::cout)
print HepMC version