test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  {
43  heprup_.idbmup[0] = heprup->IDBMUP.first;
44  heprup_.idbmup[1] = heprup->IDBMUP.second;
45  heprup_.ebmup[0] = heprup->EBMUP.first;
46  heprup_.ebmup[1] = heprup->EBMUP.second;
47  heprup_.pdfgup[0] = heprup->PDFGUP.first;
48  heprup_.pdfgup[1] = heprup->PDFGUP.second;
49  heprup_.pdfsup[0] = heprup->PDFSUP.first;
50  heprup_.pdfsup[1] = heprup->PDFSUP.second;
51  heprup_.idwtup = heprup->IDWTUP;
52  heprup_.nprup = heprup->NPRUP;
53  for(int i = 0; i < heprup->NPRUP; i++) {
54  heprup_.xsecup[i] = heprup->XSECUP[i];
55  heprup_.xerrup[i] = heprup->XERRUP[i];
56  heprup_.xmaxup[i] = heprup->XMAXUP[i];
57  heprup_.lprup[i] = heprup->LPRUP[i];
58  }
59  }
60 
61  static void fillHEPEUP(const HEPEUP *hepeup)
62  {
63  hepeup_.nup = hepeup->NUP;
64  hepeup_.idprup = hepeup->IDPRUP;
65  hepeup_.xwgtup = hepeup->XWGTUP;
66  hepeup_.scalup = hepeup->SCALUP;
67  hepeup_.aqedup = hepeup->AQEDUP;
68  hepeup_.aqcdup = hepeup->AQCDUP;
69  for(int i = 0; i < hepeup->NUP; i++) {
70  hepeup_.idup[i] = hepeup->IDUP[i];
71  hepeup_.istup[i] = hepeup->ISTUP[i];
72  hepeup_.mothup[i][0] = hepeup->MOTHUP[i].first;
73  hepeup_.mothup[i][1] = hepeup->MOTHUP[i].second;
74  hepeup_.icolup[i][0] = hepeup->ICOLUP[i].first;
75  hepeup_.icolup[i][1] = hepeup->ICOLUP[i].second;
76  for(unsigned int j = 0; j < 5; j++)
77  hepeup_.pup[i][j] = hepeup->PUP[i][j];
78  hepeup_.vtimup[i] = hepeup->VTIMUP[i];
79  hepeup_.spinup[i] = hepeup->SPINUP[i];
80  }
81  }
82 
83  static void readHEPRUP(HEPRUP *heprup)
84  {
85  heprup->resize(heprup_.nprup);
86  heprup->IDBMUP.first = heprup_.idbmup[0];
87  heprup->IDBMUP.second = heprup_.idbmup[1];
88  heprup->EBMUP.first = heprup_.ebmup[0];
89  heprup->EBMUP.second = heprup_.ebmup[1];
90  heprup->PDFGUP.first = heprup_.pdfgup[0];
91  heprup->PDFGUP.second = heprup_.pdfgup[1];
92  heprup->PDFSUP.first = heprup_.pdfsup[0];
93  heprup->PDFSUP.second = heprup_.pdfsup[1];
94  heprup->IDWTUP = heprup_.idwtup;
95  for(int i = 0; i < heprup->NPRUP; i++) {
96  heprup->XSECUP[i] = heprup_.xsecup[i];
97  heprup->XERRUP[i] = heprup_.xerrup[i];
98  heprup->XMAXUP[i] = heprup_.xmaxup[i];
99  heprup->LPRUP[i] = heprup_.lprup[i];
100  }
101  }
102 
103  static void readHEPEUP(HEPEUP *hepeup)
104  {
105  hepeup->resize(hepeup_.nup);
106  hepeup->IDPRUP = hepeup_.idprup;
107  hepeup->XWGTUP = hepeup_.xwgtup;
108  hepeup->SCALUP = hepeup_.scalup;
109  hepeup->AQEDUP = hepeup_.aqedup;
110  hepeup->AQCDUP = hepeup_.aqcdup;
111  for(int i = 0; i < hepeup->NUP; i++) {
112  hepeup->IDUP[i] = hepeup_.idup[i];
113  hepeup->ISTUP[i] = hepeup_.istup[i];
114  hepeup->MOTHUP[i].first = hepeup_.mothup[i][0];
115  hepeup->MOTHUP[i].second = hepeup_.mothup[i][1];
116  hepeup->ICOLUP[i].first = hepeup_.icolup[i][0];
117  hepeup->ICOLUP[i].second = hepeup_.icolup[i][1];
118  for(unsigned int j = 0; j < 5; j++)
119  hepeup->PUP[i][j] = hepeup_.pup[i][j];
120  hepeup->VTIMUP[i] = hepeup_.vtimup[i];
121  hepeup->SPINUP[i] = hepeup_.spinup[i];
122  }
123  }
124 
125  private:
126  CommonBlocks();
127  ~CommonBlocks();
128 };
129 
130 } // namespace lhef
131 
132 #endif // SimDataFormats_GeneratorProducts_LHECommonBlocks_h
int i
Definition: DBlmapReader.cc:9
int mothup[500][2]
void resize(int nrup)
Definition: LesHouches.h:52
double aqcdup
double spinup[500]
double ebmup[2]
int istup[500]
std::pair< double, double > EBMUP
Definition: LesHouches.h:78
struct HEPEUP_ hepeup_
int pdfgup[2]
std::vector< double > VTIMUP
Definition: LesHouches.h:254
std::pair< int, int > IDBMUP
Definition: LesHouches.h:73
struct HEPRUP_ heprup_
int idbmup[2]
std::pair< int, int > PDFGUP
Definition: LesHouches.h:84
double vtimup[500]
std::vector< std::pair< int, int > > MOTHUP
Definition: LesHouches.h:236
static void readHEPRUP(HEPRUP *heprup)
void resize(int nup)
Definition: LesHouches.h:161
double xsecup[100]
std::vector< FiveVector > PUP
Definition: LesHouches.h:248
static void fillHEPEUP(const HEPEUP *hepeup)
std::vector< double > SPINUP
Definition: LesHouches.h:261
int j
Definition: DBlmapReader.cc:9
std::vector< int > ISTUP
Definition: LesHouches.h:230
std::vector< int > IDUP
Definition: LesHouches.h:225
std::vector< double > XERRUP
Definition: LesHouches.h:114
std::vector< double > XMAXUP
Definition: LesHouches.h:119
double AQCDUP
Definition: LesHouches.h:220
double scalup
std::pair< int, int > PDFSUP
Definition: LesHouches.h:90
double xwgtup
int icolup[500][2]
double xmaxup[100]
double aqedup
double AQEDUP
Definition: LesHouches.h:215
int pdfsup[2]
std::vector< double > XSECUP
Definition: LesHouches.h:108
static void readHEPEUP(HEPEUP *hepeup)
double XWGTUP
Definition: LesHouches.h:196
int lprup[100]
double xerrup[100]
std::vector< std::pair< int, int > > ICOLUP
Definition: LesHouches.h:242
static void fillHEPRUP(const HEPRUP *heprup)
double pup[500][5]
std::vector< int > LPRUP
Definition: LesHouches.h:124
double SCALUP
Definition: LesHouches.h:210
int idup[500]