ATLAS Offline Software
HijJet1.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 #ifndef HijJet1_h
7 #define HijJet1_h
8 
9 #include <cstdint>
10 
11 extern "C" { uintptr_t hijjet1_address_(); }
16 class HijJet1 {
17 public:
18  HijJet1();
19  ~HijJet1();
20 
21  int& npj (int i);
22  int& kfpj (int i, int j);
23  float& pjpx (int i, int j);
24  float& pjpy (int i, int j);
25  float& pjpz (int i, int j);
26  float& pjpe (int i, int j);
27  float& pjpm (int i, int j);
28  int& ntj (int i);
29  int& kftj (int i, int j);
30  float& pjtx (int i, int j);
31  float& pjty (int i, int j);
32  float& pjtz (int i, int j);
33  float& pjte (int i, int j);
34  float& pjtm (int i, int j);
35 
36  void init (void);
37 
38  // return common array lengths
39  inline int lenI() const {return s_lenI;}
40  inline int lenJ() const {return s_lenJ;}
41 
42 private:
43 
44  // Lengths of array in HiMain2 common
45  static const int s_lenI = 300;
46  static const int s_lenJ = 500;
47 
48  struct HIJJET1;
49  friend struct HIJJET1;
50 
51  struct HIJJET1
52  {
53  int npj [s_lenI];
54  int kfpj [s_lenJ][s_lenI];
55  float pjpx [s_lenJ][s_lenI];
56  float pjpy [s_lenJ][s_lenI];
57  float pjpz [s_lenJ][s_lenI];
58  float pjpe [s_lenJ][s_lenI];
59  float pjpm [s_lenJ][s_lenI];
60  int ntj [s_lenI];
61  int kftj [s_lenJ][s_lenI];
62  float pjtx [s_lenJ][s_lenI];
63  float pjty [s_lenJ][s_lenI];
64  float pjtz [s_lenJ][s_lenI];
65  float pjte [s_lenJ][s_lenI];
66  float pjtm [s_lenJ][s_lenI];
67  };
68 
69  int m_dummy;
70  float m_realdummy;
71 
72  static HIJJET1* s_hijjet1;
73 };
74 
75 // set pointer to zero at start
77 
78 inline void
80 { if (!s_hijjet1) s_hijjet1 = reinterpret_cast<HIJJET1*>(hijjet1_address_()); }
81 
82 // Constructor
83 inline
85  : m_dummy (-999),
86  m_realdummy (-999.)
87 {}
88 
89 // Destructor
90 inline
92 {}
93 
94 inline int&
96 {
97  init(); // check COMMON is initialized
98  if(i < 1 || i > lenI()) return m_dummy;
99  return s_hijjet1->npj[i-1];
100 }
101 
102 inline int&
103 HijJet1::kfpj (int i, int j)
104 {
105  init(); // check COMMON is initialized
106  if( i < 1 || i > lenI() ||
107  j < 1 || j > lenJ() ) return m_dummy;
108 
109  return s_hijjet1->kfpj[j-1][i-1];
110 }
111 
112 inline float&
113 HijJet1::pjpx (int i, int j)
114 {
115  init(); // check COMMON is initialized
116  if( i < 1 || i > lenI() ||
117  j < 1 || j > lenJ() ) return m_realdummy;
118 
119  return s_hijjet1->pjpx[j-1][i-1];
120 }
121 
122 inline float&
123 HijJet1::pjpy (int i, int j)
124 {
125  init(); // check COMMON is initialized
126  if( i < 1 || i > lenI() ||
127  j < 1 || j > lenJ() ) return m_realdummy;
128 
129  return s_hijjet1->pjpy[j-1][i-1];
130 }
131 
132 inline float&
133 HijJet1::pjpz (int i, int j)
134 {
135  init(); // check COMMON is initialized
136  if( i < 1 || i > lenI() ||
137  j < 1 || j > lenJ() ) return m_realdummy;
138 
139  return s_hijjet1->pjpz[j-1][i-1];
140 }
141 
142 inline float&
143 HijJet1::pjpe (int i, int j)
144 {
145  init(); // check COMMON is initialized
146  if( i < 1 || i > lenI() ||
147  j < 1 || j > lenJ() ) return m_realdummy;
148 
149  return s_hijjet1->pjpe[j-1][i-1];
150 }
151 
152 inline float&
153 HijJet1::pjpm (int i, int j)
154 {
155  init(); // check COMMON is initialized
156  if( i < 1 || i > lenI() ||
157  j < 1 || j > lenJ() ) return m_realdummy;
158 
159  return s_hijjet1->pjpm[j-1][i-1];
160 }
161 
162 inline int&
164 {
165  init(); // check COMMON is initialized
166  if(i < 1 || i > lenI()) return m_dummy;
167  return s_hijjet1->ntj[i-1];
168 }
169 
170 inline int&
171 HijJet1::kftj (int i, int j)
172 {
173  init(); // check COMMON is initialized
174  if( i < 1 || i > lenI() ||
175  j < 1 || j > lenJ() ) return m_dummy;
176 
177  return s_hijjet1->kftj[j-1][i-1];
178 }
179 
180 inline float&
181 HijJet1::pjtx (int i, int j)
182 {
183  init(); // check COMMON is initialized
184  if( i < 1 || i > lenI() ||
185  j < 1 || j > lenJ() ) return m_realdummy;
186 
187  return s_hijjet1->pjtx[j-1][i-1];
188 }
189 
190 inline float&
191 HijJet1::pjty (int i, int j)
192 {
193  init(); // check COMMON is initialized
194  if( i < 1 || i > lenI() ||
195  j < 1 || j > lenJ() ) return m_realdummy;
196 
197  return s_hijjet1->pjty[j-1][i-1];
198 }
199 
200 inline float&
201 HijJet1::pjtz (int i, int j)
202 {
203  init(); // check COMMON is initialized
204  if( i < 1 || i > lenI() ||
205  j < 1 || j > lenJ() ) return m_realdummy;
206 
207  return s_hijjet1->pjtz[j-1][i-1];
208 }
209 
210 inline float&
211 HijJet1::pjte (int i, int j)
212 {
213  init(); // check COMMON is initialized
214  if( i < 1 || i > lenI() ||
215  j < 1 || j > lenJ() ) return m_realdummy;
216 
217  return s_hijjet1->pjte[j-1][i-1];
218 }
219 
220 inline float&
221 HijJet1::pjtm (int i, int j)
222 {
223  init(); // check COMMON is initialized
224  if( i < 1 || i > lenI() ||
225  j < 1 || j > lenJ() ) return m_realdummy;
226 
227  return s_hijjet1->pjtm[j-1][i-1];
228 }
229 
230 #endif
HijJet1::~HijJet1
~HijJet1()
Definition: HijJet1.h:91
HijJet1::pjtz
float & pjtz(int i, int j)
Definition: HijJet1.h:201
HijJet1::HIJJET1::pjpe
float pjpe[s_lenJ][s_lenI]
Definition: HijJet1.h:58
hijjet1_address_
uintptr_t hijjet1_address_()
HijJet1::init
void init(void)
Definition: HijJet1.h:79
HijJet1::HIJJET1::pjpz
float pjpz[s_lenJ][s_lenI]
Definition: HijJet1.h:57
HijJet1::HIJJET1::pjty
float pjty[s_lenJ][s_lenI]
Definition: HijJet1.h:63
HijJet1::HIJJET1::ntj
int ntj[s_lenI]
Definition: HijJet1.h:60
HijJet1::pjpz
float & pjpz(int i, int j)
Definition: HijJet1.h:133
HijJet1::m_realdummy
float m_realdummy
Definition: HijJet1.h:70
HijJet1::pjty
float & pjty(int i, int j)
Definition: HijJet1.h:191
HijJet1::HIJJET1
Definition: HijJet1.h:52
HijJet1::HIJJET1::pjpy
float pjpy[s_lenJ][s_lenI]
Definition: HijJet1.h:56
HijJet1::pjtx
float & pjtx(int i, int j)
Definition: HijJet1.h:181
HijJet1::ntj
int & ntj(int i)
Definition: HijJet1.h:163
lumiFormat.i
int i
Definition: lumiFormat.py:85
HijJet1::HIJJET1::pjte
float pjte[s_lenJ][s_lenI]
Definition: HijJet1.h:65
HijJet1::kftj
int & kftj(int i, int j)
Definition: HijJet1.h:171
HijJet1::HIJJET1::kftj
int kftj[s_lenJ][s_lenI]
Definition: HijJet1.h:61
HijJet1::pjpe
float & pjpe(int i, int j)
Definition: HijJet1.h:143
HijJet1::s_lenJ
static const int s_lenJ
Definition: HijJet1.h:46
HijJet1::HIJJET1::pjtx
float pjtx[s_lenJ][s_lenI]
Definition: HijJet1.h:62
HijJet1::lenI
int lenI() const
Definition: HijJet1.h:39
HijJet1::HIJJET1::pjtm
float pjtm[s_lenJ][s_lenI]
Definition: HijJet1.h:66
HijJet1::kfpj
int & kfpj(int i, int j)
Definition: HijJet1.h:103
HijJet1::lenJ
int lenJ() const
Definition: HijJet1.h:40
HijJet1::HIJJET1::pjpx
float pjpx[s_lenJ][s_lenI]
Definition: HijJet1.h:55
HijJet1::pjpy
float & pjpy(int i, int j)
Definition: HijJet1.h:123
HijJet1::HIJJET1::kfpj
int kfpj[s_lenJ][s_lenI]
Definition: HijJet1.h:54
HijJet1::s_hijjet1
static HIJJET1 * s_hijjet1
Definition: HijJet1.h:72
HijJet1
Class definition for HijJet1, which is used to modify the Hijing HIJJET1 common.
Definition: HijJet1.h:16
HijJet1::s_lenI
static const int s_lenI
Definition: HijJet1.h:45
HijJet1::HIJJET1::pjtz
float pjtz[s_lenJ][s_lenI]
Definition: HijJet1.h:64
HijJet1::m_dummy
int m_dummy
Definition: HijJet1.h:69
HijJet1::pjpm
float & pjpm(int i, int j)
Definition: HijJet1.h:153
HijJet1::HIJJET1::pjpm
float pjpm[s_lenJ][s_lenI]
Definition: HijJet1.h:59
HijJet1::HIJJET1::npj
int npj[s_lenI]
Definition: HijJet1.h:53
HijJet1::HijJet1
HijJet1()
Definition: HijJet1.h:84
HijJet1::pjtm
float & pjtm(int i, int j)
Definition: HijJet1.h:221
HijJet1::npj
int & npj(int i)
Definition: HijJet1.h:95
HijJet1::pjpx
float & pjpx(int i, int j)
Definition: HijJet1.h:113
HijJet1::pjte
float & pjte(int i, int j)
Definition: HijJet1.h:211