CMS 3D CMS Logo

LHEEventProduct.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <iomanip>
3 #include <sstream>
4 #include <string>
5 
8 
10 {
11  const lhef::HEPEUP &hepeup = event->hepeup();
12  int line = this->line++;
13 
14  if (!line) {
15  std::ostringstream ss;
16  ss << std::setprecision(7)
17  << std::scientific
18  << std::uppercase
19  << " " << hepeup.NUP
20  << " " << hepeup.IDPRUP
21  << " " << event->originalXWGTUP()
22  << " " << hepeup.SCALUP
23  << " " << hepeup.AQEDUP
24  << " " << hepeup.AQCDUP << std::endl;
25  tmp = ss.str();
26  return;
27  }
28  line--;
29 
30  if (line < hepeup.NUP) {
31  std::ostringstream ss;
32  ss << std::setprecision(10)
33  << std::scientific
34  << std::uppercase
35  << "\t" << hepeup.IDUP[line]
36  << "\t" << hepeup.ISTUP[line]
37  << "\t" << hepeup.MOTHUP[line].first
38  << "\t" << hepeup.MOTHUP[line].second
39  << "\t" << hepeup.ICOLUP[line].first
40  << "\t" << hepeup.ICOLUP[line].second
41  << "\t" << hepeup.PUP[line][0]
42  << "\t" << hepeup.PUP[line][1]
43  << "\t" << hepeup.PUP[line][2]
44  << "\t" << hepeup.PUP[line][3]
45  << "\t" << hepeup.PUP[line][4]
46  << std::setprecision(3)
47  << "\t" << hepeup.VTIMUP[line]
48  << std::setprecision(1)
49  << std::fixed
50  << "\t" << hepeup.SPINUP[line] << std::endl;
51  tmp = ss.str();
52  return;
53  }
54  line -= hepeup.NUP;
55 
56  if (event->pdf()) {
57  if (!line) {
58  const PDF &pdf = *event->pdf();
59  std::ostringstream ss;
60  ss << std::setprecision(7)
61  << std::scientific
62  << std::uppercase
63  << "#pdf " << pdf.id.first
64  << " " << pdf.id.second
65  << " " << pdf.x.first
66  << " " << pdf.x.second
67  << " " << pdf.scalePDF
68  << " " << pdf.xPDF.first
69  << " " << pdf.xPDF.second << std::endl;
70  tmp = ss.str();
71  return;
72  }
73  line--;
74  }
75 
76  if (line < (int)event->comments_size()) {
77  tmp = *(event->comments_begin() + line);
78  return;
79  }
80  line -= event->comments_size();
81 
82  if (!line) {
83  tmp = "</event>\n";
84  return;
85  }
86 
87  tmp.clear();
88  this->line = npos;
89 }
90 
92 {
94  result.event = this;
95  result.line = 0;
96  result.tmp = "<event>\n";
97  return result;
98 }
const_iterator begin() const
const lhef::HEPEUP & hepeup() const
const PDF * pdf() const
std::pair< double, double > x
Definition: PdfInfo.h:13
std::vector< double > VTIMUP
Definition: LesHouches.h:267
std::pair< double, double > xPDF
Definition: PdfInfo.h:14
const LHEEventProduct * event
std::vector< std::pair< int, int > > MOTHUP
Definition: LesHouches.h:249
std::vector< FiveVector > PUP
Definition: LesHouches.h:261
std::vector< double > SPINUP
Definition: LesHouches.h:274
std::vector< int > ISTUP
Definition: LesHouches.h:243
std::vector< int > IDUP
Definition: LesHouches.h:238
std::pair< int, int > id
Definition: PdfInfo.h:12
double AQCDUP
Definition: LesHouches.h:233
static const unsigned int npos
double AQEDUP
Definition: LesHouches.h:228
double scalePDF
Definition: PdfInfo.h:15
std::vector< std::pair< int, int > > ICOLUP
Definition: LesHouches.h:255
Definition: event.py:1
double SCALUP
Definition: LesHouches.h:223