ATLAS Offline Software
HyfPar.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //
6 // Description:
7 // Class definition for HyfPar, which is used
8 // to modify HYFPAR common.
9 
10 #ifndef HyfPar_h
11 #define HyfPar_h
12 
13 #include <cstdint>
14 
15 extern "C" { uintptr_t hyfpar_address_(); }
16 
17 class HyfPar {
18 public:
19  HyfPar();
20  ~HyfPar();
21 
22  double& bgen (void);
23  double& nbcol (void);
24  double& npart (void);
25  int& npyt (void);
26  int& nhyd (void);
27 
28  void init (void);
29 
30 private:
31 
32  struct HYFPAR;
33  friend struct HYFPAR;
34 
35  struct HYFPAR
36  {
37  double bgen;
38  double nbcol;
39  double npart;
40  int npyt;
41  int nhyd;
42  };
43 
44  static HYFPAR* s_hyfpar;
45 };
46 
47 // set pointer to zero at start
49 
50 inline void
52 { if (!s_hyfpar) s_hyfpar = reinterpret_cast<HYFPAR*>(hyfpar_address_()); }
53 
54 // Constructor
55 inline
57 {}
58 
59 // Destructor
60 inline
62 {}
63 
64 inline double&
66 {
67  init();
68  return s_hyfpar->bgen;
69 }
70 
71 inline double&
73 {
74  init();
75  return s_hyfpar->nbcol;
76 }
77 
78 inline double&
80 {
81  init();
82  return s_hyfpar->npart;
83 }
84 
85 inline int&
87 {
88  init();
89  return s_hyfpar->npyt;
90 }
91 
92 inline int&
94 {
95  init();
96  return s_hyfpar->nhyd;
97 }
98 
99 #endif
hyfpar_address_
uintptr_t hyfpar_address_()
HyfPar::HYFPAR::npyt
int npyt
Definition: HyfPar.h:40
HyfPar::s_hyfpar
static HYFPAR * s_hyfpar
Definition: HyfPar.h:44
HyfPar::nhyd
int & nhyd(void)
Definition: HyfPar.h:93
HyfPar::bgen
double & bgen(void)
Definition: HyfPar.h:65
HyfPar::nbcol
double & nbcol(void)
Definition: HyfPar.h:72
HyfPar::HYFPAR::npart
double npart
Definition: HyfPar.h:39
HyfPar::init
void init(void)
Definition: HyfPar.h:51
HyfPar::HYFPAR::nbcol
double nbcol
Definition: HyfPar.h:38
HyfPar::HYFPAR
Definition: HyfPar.h:36
HyfPar::HYFPAR::nhyd
int nhyd
Definition: HyfPar.h:41
HyfPar::HYFPAR::bgen
double bgen
Definition: HyfPar.h:37
HyfPar::~HyfPar
~HyfPar()
Definition: HyfPar.h:61
HyfPar::npart
double & npart(void)
Definition: HyfPar.h:79
HyfPar::npyt
int & npyt(void)
Definition: HyfPar.h:86
HyfPar
Definition: HyfPar.h:17
HyfPar::HyfPar
HyfPar()
Definition: HyfPar.h:56