ATLAS Offline Software
HyiPar.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 HyiPar which is used
8 // to modify HYIPAR common.
9 
10 #ifndef HyiPar_h
11 #define HyiPar_h
12 
13 #include <cstdint>
14 
15 extern "C" { uintptr_t hyipar_address_(); }
16 
17 class HyiPar {
18 public:
19  HyiPar();
20  ~HyiPar();
21 
22  double& bminh (void);
23  double& bmaxh (void);
24  double& AW (void);
25  double& RA (void);
26  double& npar0 (void);
27  double& nbco0 (void);
28  double& Apb (void);
29  double& Rpb (void);
30  int& np (void);
31  int& init (void);
32  int& ipr (void);
33 
34  void initf (void);
35 
36 private:
37 
38  struct HYIPAR;
39  friend struct HYIPAR;
40 
41  struct HYIPAR
42  {
43  double bminh;
44  double bmaxh;
45  double AW;
46  double RA;
47  double npar0;
48  double nbco0;
49  double Apb;
50  double Rpb;
51  int np;
52  int init;
53  int ipr;
54  };
55 
56  static HYIPAR* s_hyipar;
57 };
58 
59 // set pointer to zero at start
61 
62 inline void
64 { if (!s_hyipar) s_hyipar = reinterpret_cast<HYIPAR*>(hyipar_address_()); }
65 
66 inline
68 {}
69 
70 inline
72 {}
73 
74 inline double&
76 {
77  initf();
78  return s_hyipar->bminh;
79 }
80 
81 inline double&
83 {
84  initf();
85  return s_hyipar->bmaxh;
86 }
87 
88 inline double&
89 HyiPar::AW (void)
90 {
91  initf();
92  return s_hyipar->AW;
93 }
94 
95 inline double&
96 HyiPar::RA (void)
97 {
98  initf();
99  return s_hyipar->RA;
100 }
101 
102 inline double&
104 {
105  initf();
106  return s_hyipar->npar0;
107 }
108 
109 inline double&
111 {
112  initf();
113  return s_hyipar->nbco0;
114 }
115 
116 inline double&
118 {
119  initf();
120  return s_hyipar->Apb;
121 }
122 
123 inline double&
125 {
126  initf();
127  return s_hyipar->Rpb;
128 }
129 
130 inline int&
132 {
133  initf();
134  return s_hyipar->np;
135 }
136 
137 inline int&
139 {
140  initf();
141  return s_hyipar->init;
142 }
143 
144 inline int&
146 {
147  initf();
148  return s_hyipar->ipr;
149 }
150 #endif
HyiPar
Definition: HyiPar.h:17
HyiPar::HYIPAR::bminh
double bminh
Definition: HyiPar.h:43
HyiPar::~HyiPar
~HyiPar()
Definition: HyiPar.h:71
HyiPar::bminh
double & bminh(void)
Definition: HyiPar.h:75
HyiPar::HYIPAR::init
int init
Definition: HyiPar.h:52
HyiPar::HYIPAR::Rpb
double Rpb
Definition: HyiPar.h:50
HyiPar::Apb
double & Apb(void)
Definition: HyiPar.h:117
HyiPar::HYIPAR::AW
double AW
Definition: HyiPar.h:45
HyiPar::AW
double & AW(void)
Definition: HyiPar.h:89
HyiPar::s_hyipar
static HYIPAR * s_hyipar
Definition: HyiPar.h:56
HyiPar::npar0
double & npar0(void)
Definition: HyiPar.h:103
HyiPar::ipr
int & ipr(void)
Definition: HyiPar.h:145
HyiPar::initf
void initf(void)
Definition: HyiPar.h:63
HyiPar::HYIPAR::RA
double RA
Definition: HyiPar.h:46
HyiPar::HYIPAR::bmaxh
double bmaxh
Definition: HyiPar.h:44
HyiPar::HYIPAR::npar0
double npar0
Definition: HyiPar.h:47
HyiPar::nbco0
double & nbco0(void)
Definition: HyiPar.h:110
HyiPar::Rpb
double & Rpb(void)
Definition: HyiPar.h:124
HyiPar::HyiPar
HyiPar()
Definition: HyiPar.h:67
HyiPar::RA
double & RA(void)
Definition: HyiPar.h:96
HyiPar::HYIPAR::np
int np
Definition: HyiPar.h:51
HyiPar::bmaxh
double & bmaxh(void)
Definition: HyiPar.h:82
hyipar_address_
uintptr_t hyipar_address_()
HyiPar::HYIPAR::Apb
double Apb
Definition: HyiPar.h:49
HyiPar::init
int & init(void)
Definition: HyiPar.h:138
HyiPar::HYIPAR::nbco0
double nbco0
Definition: HyiPar.h:48
HyiPar::np
int & np(void)
Definition: HyiPar.h:131
HyiPar::HYIPAR
Definition: HyiPar.h:42
HyiPar::HYIPAR::ipr
int ipr
Definition: HyiPar.h:53