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  const lhef::HEPEUP &hepeup = event->hepeup();
11  int line = this->line++;
12 
13  if (!line) {
14  std::ostringstream ss;
15  ss << std::setprecision(7) << std::scientific << std::uppercase << " " << hepeup.NUP << " " << hepeup.IDPRUP
16  << " " << event->originalXWGTUP() << " " << hepeup.SCALUP << " " << hepeup.AQEDUP << " " << hepeup.AQCDUP
17  << std::endl;
18  tmp = ss.str();
19  return;
20  }
21  line--;
22 
23  if (line < hepeup.NUP) {
24  std::ostringstream ss;
25  ss << std::setprecision(10) << std::scientific << std::uppercase << "\t" << hepeup.IDUP[line] << "\t"
26  << hepeup.ISTUP[line] << "\t" << hepeup.MOTHUP[line].first << "\t" << hepeup.MOTHUP[line].second << "\t"
27  << hepeup.ICOLUP[line].first << "\t" << hepeup.ICOLUP[line].second << "\t" << hepeup.PUP[line][0] << "\t"
28  << hepeup.PUP[line][1] << "\t" << hepeup.PUP[line][2] << "\t" << hepeup.PUP[line][3] << "\t"
29  << hepeup.PUP[line][4] << std::setprecision(3) << "\t" << hepeup.VTIMUP[line] << std::setprecision(1)
30  << std::fixed << "\t" << hepeup.SPINUP[line] << std::endl;
31  tmp = ss.str();
32  return;
33  }
34  line -= hepeup.NUP;
35 
36  if (event->pdf()) {
37  if (!line) {
38  const PDF &pdf = *event->pdf();
39  std::ostringstream ss;
40  ss << std::setprecision(7) << std::scientific << std::uppercase << "#pdf " << pdf.id.first << " "
41  << pdf.id.second << " " << pdf.x.first << " " << pdf.x.second << " " << pdf.scalePDF << " "
42  << pdf.xPDF.first << " " << pdf.xPDF.second << std::endl;
43  tmp = ss.str();
44  return;
45  }
46  line--;
47  }
48 
49  if (line < (int)event->comments_size()) {
50  tmp = *(event->comments_begin() + line);
51  return;
52  }
53  line -= event->comments_size();
54 
55  if (!line) {
56  tmp = "</event>\n";
57  return;
58  }
59 
60  tmp.clear();
61  this->line = npos;
62 }
63 
66  result.event = this;
67  result.line = 0;
68  result.tmp = "<event>\n";
69  return result;
70 }
const_iterator begin() const
std::vector< std::pair< int, int > > ICOLUP
Definition: LesHouches.h:240
std::pair< double, double > x
Definition: PdfInfo.h:13
std::vector< double > VTIMUP
Definition: LesHouches.h:252
std::pair< double, double > xPDF
Definition: PdfInfo.h:14
std::vector< FiveVector > PUP
Definition: LesHouches.h:246
std::vector< double > SPINUP
Definition: LesHouches.h:259
std::vector< int > ISTUP
Definition: LesHouches.h:228
std::vector< std::pair< int, int > > MOTHUP
Definition: LesHouches.h:234
std::vector< int > IDUP
Definition: LesHouches.h:223
const PDF * pdf() const
std::pair< int, int > id
Definition: PdfInfo.h:12
double AQCDUP
Definition: LesHouches.h:218
static const unsigned int npos
double AQEDUP
Definition: LesHouches.h:213
double scalePDF
Definition: PdfInfo.h:15
Definition: event.py:1
double SCALUP
Definition: LesHouches.h:208
const lhef::HEPEUP & hepeup() const