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  private:
122  CommonBlocks() = delete;
123  ~CommonBlocks() = delete;
124  };
125 
126 } // namespace lhef
127 
128 #endif // SimDataFormats_GeneratorProducts_LHECommonBlocks_h
lhef::HEPEUP::AQCDUP
double AQCDUP
Definition: LesHouches.h:218
lhef::HEPRUP::XSECUP
std::vector< double > XSECUP
Definition: LesHouches.h:112
lhef::CommonBlocks::readHEPEUP
static void readHEPEUP(HEPEUP *hepeup)
Definition: LHECommonBlocks.h:100
heprup_
struct HEPRUP_ heprup_
mps_fire.i
i
Definition: mps_fire.py:428
lhef::CommonBlocks
Definition: LHECommonBlocks.h:39
lhef::HEPEUP::MOTHUP
std::vector< std::pair< int, int > > MOTHUP
Definition: LesHouches.h:234
lhef::HEPEUP::ISTUP
std::vector< int > ISTUP
Definition: LesHouches.h:228
lhef::CommonBlocks::~CommonBlocks
~CommonBlocks()=delete
HEPRUP_::xmaxup
double xmaxup[100]
Definition: LHECommonBlocks.h:16
HEPEUP_::spinup
double spinup[500]
Definition: LHECommonBlocks.h:33
lhef::HEPEUP::SPINUP
std::vector< double > SPINUP
Definition: LesHouches.h:259
HEPEUP_::aqedup
double aqedup
Definition: LHECommonBlocks.h:25
lhef::CommonBlocks::readHEPRUP
static void readHEPRUP(HEPRUP *heprup)
Definition: LHECommonBlocks.h:81
HEPRUP_::pdfsup
int pdfsup[2]
Definition: LHECommonBlocks.h:11
HEPEUP_::pup
double pup[500][5]
Definition: LHECommonBlocks.h:31
lhef::HEPRUP::EBMUP
std::pair< double, double > EBMUP
Definition: LesHouches.h:82
lhef::CommonBlocks::fillHEPEUP
static void fillHEPEUP(const HEPEUP *hepeup)
Definition: LHECommonBlocks.h:60
lhef::HEPEUP::NUP
int NUP
Definition: LesHouches.h:184
HEPEUP_::xwgtup
double xwgtup
Definition: LHECommonBlocks.h:23
HEPEUP_::istup
int istup[500]
Definition: LHECommonBlocks.h:28
hepeup_
struct HEPEUP_ hepeup_
HEPEUP_::aqcdup
double aqcdup
Definition: LHECommonBlocks.h:26
lhef::HEPRUP::LPRUP
std::vector< int > LPRUP
Definition: LesHouches.h:128
HEPEUP_::idprup
int idprup
Definition: LHECommonBlocks.h:22
lhef::HEPEUP::ICOLUP
std::vector< std::pair< int, int > > ICOLUP
Definition: LesHouches.h:240
lhef::HEPRUP::PDFGUP
std::pair< int, int > PDFGUP
Definition: LesHouches.h:88
lhef::HEPEUP::VTIMUP
std::vector< double > VTIMUP
Definition: LesHouches.h:252
HEPEUP_::icolup
int icolup[500][2]
Definition: LHECommonBlocks.h:30
lhef
Definition: ExhumeHadronizer.h:12
lhef::HEPRUP::resize
void resize(int nrup)
Definition: LesHouches.h:44
HEPRUP_::pdfgup
int pdfgup[2]
Definition: LHECommonBlocks.h:10
HEPRUP_::idwtup
int idwtup
Definition: LHECommonBlocks.h:12
lhef::HEPRUP::NPRUP
int NPRUP
Definition: LesHouches.h:107
HEPRUP_::idbmup
int idbmup[2]
Definition: LHECommonBlocks.h:8
HEPRUP_::ebmup
double ebmup[2]
Definition: LHECommonBlocks.h:9
lhef::CommonBlocks::fillHEPRUP
static void fillHEPRUP(const HEPRUP *heprup)
Definition: LHECommonBlocks.h:41
lhef::HEPRUP
Definition: LesHouches.h:22
lhef::HEPRUP::IDWTUP
int IDWTUP
Definition: LesHouches.h:101
lhef::HEPEUP::AQEDUP
double AQEDUP
Definition: LesHouches.h:213
lhef::HEPEUP
Definition: LesHouches.h:138
LesHouches.h
lhef::HEPEUP::XWGTUP
double XWGTUP
Definition: LesHouches.h:194
lhef::HEPRUP::XERRUP
std::vector< double > XERRUP
Definition: LesHouches.h:118
lhef::HEPRUP::PDFSUP
std::pair< int, int > PDFSUP
Definition: LesHouches.h:94
HEPEUP_::mothup
int mothup[500][2]
Definition: LHECommonBlocks.h:29
HEPEUP_::idup
int idup[500]
Definition: LHECommonBlocks.h:27
lhef::HEPEUP::IDUP
std::vector< int > IDUP
Definition: LesHouches.h:223
HEPRUP_::xsecup
double xsecup[100]
Definition: LHECommonBlocks.h:14
HEPEUP_
Definition: LHECommonBlocks.h:20
HEPEUP_::nup
int nup
Definition: LHECommonBlocks.h:21
lhef::HEPEUP::IDPRUP
int IDPRUP
Definition: LesHouches.h:189
HEPRUP_::nprup
int nprup
Definition: LHECommonBlocks.h:13
HEPRUP_
Definition: LHECommonBlocks.h:7
lhef::HEPEUP::resize
void resize(int nup)
Definition: LesHouches.h:161
HEPEUP_::vtimup
double vtimup[500]
Definition: LHECommonBlocks.h:32
HEPRUP_::xerrup
double xerrup[100]
Definition: LHECommonBlocks.h:15
HEPRUP_::lprup
int lprup[100]
Definition: LHECommonBlocks.h:17
lhef::HEPRUP::XMAXUP
std::vector< double > XMAXUP
Definition: LesHouches.h:123
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
lhef::HEPEUP::PUP
std::vector< FiveVector > PUP
Definition: LesHouches.h:246
HEPEUP_::scalup
double scalup
Definition: LHECommonBlocks.h:24
lhef::HEPEUP::SCALUP
double SCALUP
Definition: LesHouches.h:208
lhef::CommonBlocks::CommonBlocks
CommonBlocks()=delete
lhef::HEPRUP::IDBMUP
std::pair< int, int > IDBMUP
Definition: LesHouches.h:77