CMS 3D CMS Logo

LHECommonBlocks.h
Go to the documentation of this file.
1 #ifndef SimDataFormats_GeneratorProducts_LHECommonBlocks_h
2 #define SimDataFormats_GeneratorProducts_LHECommonBlocks_h
3 
5 
6 extern "C" {
7 extern struct HEPRUP_ {
8  int idbmup[2];
9  double ebmup[2];
10  int pdfgup[2];
11  int pdfsup[2];
12  int idwtup;
13  int nprup;
14  double xsecup[100];
15  double xerrup[100];
16  double xmaxup[100];
17  int lprup[100];
18 } heprup_;
19 
20 extern struct HEPEUP_ {
21  int nup;
22  int idprup;
23  double xwgtup;
24  double scalup;
25  double aqedup;
26  double aqcdup;
27  int idup[500];
28  int istup[500];
29  int mothup[500][2];
30  int icolup[500][2];
31  double pup[500][5];
32  double vtimup[500];
33  double spinup[500];
34 } hepeup_;
35 } // extern "C"
36 
37 namespace lhef {
38 
39  class CommonBlocks {
40  public:
41  static void fillHEPRUP(const HEPRUP *heprup) {
42  heprup_.idbmup[0] = heprup->IDBMUP.first;
43  heprup_.idbmup[1] = heprup->IDBMUP.second;
44  heprup_.ebmup[0] = heprup->EBMUP.first;
45  heprup_.ebmup[1] = heprup->EBMUP.second;
46  heprup_.pdfgup[0] = heprup->PDFGUP.first;
47  heprup_.pdfgup[1] = heprup->PDFGUP.second;
48  heprup_.pdfsup[0] = heprup->PDFSUP.first;
49  heprup_.pdfsup[1] = heprup->PDFSUP.second;
50  heprup_.idwtup = heprup->IDWTUP;
51  heprup_.nprup = heprup->NPRUP;
52  for (int i = 0; i < heprup->NPRUP; i++) {
53  heprup_.xsecup[i] = heprup->XSECUP[i];
54  heprup_.xerrup[i] = heprup->XERRUP[i];
55  heprup_.xmaxup[i] = heprup->XMAXUP[i];
56  heprup_.lprup[i] = heprup->LPRUP[i];
57  }
58  }
59 
60  static void fillHEPEUP(const HEPEUP *hepeup) {
61  hepeup_.nup = hepeup->NUP;
62  hepeup_.idprup = hepeup->IDPRUP;
63  hepeup_.xwgtup = hepeup->XWGTUP;
64  hepeup_.scalup = hepeup->SCALUP;
65  hepeup_.aqedup = hepeup->AQEDUP;
66  hepeup_.aqcdup = hepeup->AQCDUP;
67  for (int i = 0; i < hepeup->NUP; i++) {
68  hepeup_.idup[i] = hepeup->IDUP[i];
69  hepeup_.istup[i] = hepeup->ISTUP[i];
70  hepeup_.mothup[i][0] = hepeup->MOTHUP[i].first;
71  hepeup_.mothup[i][1] = hepeup->MOTHUP[i].second;
72  hepeup_.icolup[i][0] = hepeup->ICOLUP[i].first;
73  hepeup_.icolup[i][1] = hepeup->ICOLUP[i].second;
74  for (unsigned int j = 0; j < 5; j++)
75  hepeup_.pup[i][j] = hepeup->PUP[i][j];
76  hepeup_.vtimup[i] = hepeup->VTIMUP[i];
77  hepeup_.spinup[i] = hepeup->SPINUP[i];
78  }
79  }
80 
81  static void readHEPRUP(HEPRUP *heprup) {
82  heprup->resize(heprup_.nprup);
83  heprup->IDBMUP.first = heprup_.idbmup[0];
84  heprup->IDBMUP.second = heprup_.idbmup[1];
85  heprup->EBMUP.first = heprup_.ebmup[0];
86  heprup->EBMUP.second = heprup_.ebmup[1];
87  heprup->PDFGUP.first = heprup_.pdfgup[0];
88  heprup->PDFGUP.second = heprup_.pdfgup[1];
89  heprup->PDFSUP.first = heprup_.pdfsup[0];
90  heprup->PDFSUP.second = heprup_.pdfsup[1];
91  heprup->IDWTUP = heprup_.idwtup;
92  for (int i = 0; i < heprup->NPRUP; i++) {
93  heprup->XSECUP[i] = heprup_.xsecup[i];
94  heprup->XERRUP[i] = heprup_.xerrup[i];
95  heprup->XMAXUP[i] = heprup_.xmaxup[i];
96  heprup->LPRUP[i] = heprup_.lprup[i];
97  }
98  }
99 
100  static void readHEPEUP(HEPEUP *hepeup) {
101  hepeup->resize(hepeup_.nup);
102  hepeup->IDPRUP = hepeup_.idprup;
103  hepeup->XWGTUP = hepeup_.xwgtup;
104  hepeup->SCALUP = hepeup_.scalup;
105  hepeup->AQEDUP = hepeup_.aqedup;
106  hepeup->AQCDUP = hepeup_.aqcdup;
107  for (int i = 0; i < hepeup->NUP; i++) {
108  hepeup->IDUP[i] = hepeup_.idup[i];
109  hepeup->ISTUP[i] = hepeup_.istup[i];
110  hepeup->MOTHUP[i].first = hepeup_.mothup[i][0];
111  hepeup->MOTHUP[i].second = hepeup_.mothup[i][1];
112  hepeup->ICOLUP[i].first = hepeup_.icolup[i][0];
113  hepeup->ICOLUP[i].second = hepeup_.icolup[i][1];
114  for (unsigned int j = 0; j < 5; j++)
115  hepeup->PUP[i][j] = hepeup_.pup[i][j];
116  hepeup->VTIMUP[i] = hepeup_.vtimup[i];
117  hepeup->SPINUP[i] = hepeup_.spinup[i];
118  }
119  }
120 
121  CommonBlocks() = delete;
122  ~CommonBlocks() = delete;
123  };
124 
125 } // namespace lhef
126 
127 #endif // SimDataFormats_GeneratorProducts_LHECommonBlocks_h
int mothup[500][2]
void resize(int nrup)
Definition: LesHouches.h:44
double aqcdup
double spinup[500]
double ebmup[2]
int istup[500]
std::vector< std::pair< int, int > > ICOLUP
Definition: LesHouches.h:240
std::pair< double, double > EBMUP
Definition: LesHouches.h:82
struct HEPEUP_ hepeup_
int pdfgup[2]
std::vector< double > VTIMUP
Definition: LesHouches.h:252
std::pair< int, int > IDBMUP
Definition: LesHouches.h:77
struct HEPRUP_ heprup_
int idbmup[2]
std::pair< int, int > PDFGUP
Definition: LesHouches.h:88
double vtimup[500]
static void readHEPRUP(HEPRUP *heprup)
void resize(int nup)
Definition: LesHouches.h:161
double xsecup[100]
std::vector< FiveVector > PUP
Definition: LesHouches.h:246
static void fillHEPEUP(const HEPEUP *hepeup)
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
std::vector< double > XERRUP
Definition: LesHouches.h:118
std::vector< double > XMAXUP
Definition: LesHouches.h:123
double AQCDUP
Definition: LesHouches.h:218
double scalup
std::pair< int, int > PDFSUP
Definition: LesHouches.h:94
double xwgtup
int icolup[500][2]
double xmaxup[100]
~CommonBlocks()=delete
double aqedup
double AQEDUP
Definition: LesHouches.h:213
int pdfsup[2]
std::vector< double > XSECUP
Definition: LesHouches.h:112
static void readHEPEUP(HEPEUP *hepeup)
double XWGTUP
Definition: LesHouches.h:194
int lprup[100]
double xerrup[100]
static void fillHEPRUP(const HEPRUP *heprup)
double pup[500][5]
std::vector< int > LPRUP
Definition: LesHouches.h:128
double SCALUP
Definition: LesHouches.h:208
int idup[500]