ATLAS Offline Software
HijJet2.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 HijJet2_h
7 #define HijJet2_h
8 
9 #include <cstdint>
10 
11 extern "C" { uintptr_t hijjet2_address_(); }
18 class HijJet2 {
19 public:
20  HijJet2();
21  ~HijJet2();
22 
23  int& nsg (void);
24  int& njsg (int i);
25  int& iasg (int i, int k);
26  int& k1sg (int i, int j);
27  int& k2sg (int i, int j);
28  float& pxsg (int i, int j);
29  float& pysg (int i, int j);
30  float& pzsg (int i, int j);
31  float& pesg (int i, int j);
32  float& pmsg (int i, int j);
33 
34  void init (void);
35 
36  // return common array lengths
37  inline int lenI() const {return s_lenI;}
38  inline int lenJ() const {return s_lenJ;}
39  inline int lenK() const {return s_lenK;}
40 
41 private:
42 
43  // Lengths of array in HiMain2 common
44  static const int s_lenI = 900;
45  static const int s_lenJ = 100;
46  static const int s_lenK = 3;
47 
48  struct HIJJET2;
49  friend struct HIJJET2;
50 
51  struct HIJJET2
52  {
53  int nsg;
54  int njsg [s_lenI];
55  int iasg [s_lenK][s_lenI];
56  int k1sg [s_lenJ][s_lenI];
57  int k2sg [s_lenJ][s_lenI];
58  float pxsg [s_lenJ][s_lenI];
59  float pysg [s_lenJ][s_lenI];
60  float pzsg [s_lenJ][s_lenI];
61  float pesg [s_lenJ][s_lenI];
62  float pmsg [s_lenJ][s_lenI];
63  };
64 
65  int m_dummy;
66  float m_realdummy;
67 
68  static HIJJET2* s_hijjet2;
69 };
70 
71 // set pointer to zero at start
73 
74 inline void
76 { if (!s_hijjet2) s_hijjet2 = reinterpret_cast<HIJJET2*>(hijjet2_address_()); }
77 
78 // Constructor
79 inline
81  : m_dummy (-999),
82  m_realdummy (-999.)
83 {}
84 
85 // Destructor
86 inline
88 {}
89 
90 inline int&
92 {
93  init(); // check COMMON is initialized
94  return s_hijjet2->nsg;
95 }
96 
97 inline int&
99 {
100  init(); // check COMMON is initialized
101  if(i < 1 || i > lenI()) return m_dummy;
102  return s_hijjet2->njsg[i-1];
103 }
104 
105 inline int&
106 HijJet2::iasg (int i, int k)
107 {
108  init(); // check COMMON is initialized
109  if( i < 1 || i > lenI() ||
110  k < 1 || k > lenK() ) return m_dummy;
111 
112  return s_hijjet2->iasg[k-1][i-1];
113 }
114 
115 inline int&
116 HijJet2::k1sg (int i, int j)
117 {
118  init(); // check COMMON is initialized
119  if( i < 1 || i > lenI() ||
120  j < 1 || j > lenJ() ) return m_dummy;
121 
122  return s_hijjet2->k1sg[j-1][i-1];
123 }
124 
125 inline int&
126 HijJet2::k2sg (int i, int j)
127 {
128  init(); // check COMMON is initialized
129  if( i < 1 || i > lenI() ||
130  j < 1 || j > lenJ() ) return m_dummy;
131 
132  return s_hijjet2->k2sg[j-1][i-1];
133 }
134 
135 inline float&
136 HijJet2::pxsg (int i, int j)
137 {
138  init(); // check COMMON is initialized
139  if( i < 1 || i > lenI() ||
140  j < 1 || j > lenJ() ) return m_realdummy;
141 
142  return s_hijjet2->pxsg[j-1][i-1];
143 }
144 
145 inline float&
146 HijJet2::pysg (int i, int j)
147 {
148  init(); // check COMMON is initialized
149  if( i < 1 || i > lenI() ||
150  j < 1 || j > lenJ() ) return m_realdummy;
151 
152  return s_hijjet2->pysg[j-1][i-1];
153 }
154 
155 inline float&
156 HijJet2::pzsg (int i, int j)
157 {
158  init(); // check COMMON is initialized
159  if( i < 1 || i > lenI() ||
160  j < 1 || j > lenJ() ) return m_realdummy;
161 
162  return s_hijjet2->pzsg[j-1][i-1];
163 }
164 
165 inline float&
166 HijJet2::pesg (int i, int j)
167 {
168  init(); // check COMMON is initialized
169  if( i < 1 || i > lenI() ||
170  j < 1 || j > lenJ() ) return m_realdummy;
171 
172  return s_hijjet2->pesg[j-1][i-1];
173 }
174 
175 inline float&
176 HijJet2::pmsg (int i, int j)
177 {
178  init(); // check COMMON is initialized
179  if( i < 1 || i > lenI() ||
180  j < 1 || j > lenJ() ) return m_realdummy;
181 
182  return s_hijjet2->pmsg[j-1][i-1];
183 }
184 
185 #endif
HijJet2::HIJJET2
Definition: HijJet2.h:52
HijJet2::lenK
int lenK() const
Definition: HijJet2.h:39
HijJet2::pesg
float & pesg(int i, int j)
Definition: HijJet2.h:166
HijJet2::init
void init(void)
Definition: HijJet2.h:75
HijJet2::s_lenK
static const int s_lenK
Definition: HijJet2.h:46
HijJet2::njsg
int & njsg(int i)
Definition: HijJet2.h:98
HijJet2::s_lenI
static const int s_lenI
Definition: HijJet2.h:44
HijJet2::HIJJET2::k1sg
int k1sg[s_lenJ][s_lenI]
Definition: HijJet2.h:56
HijJet2::HIJJET2::k2sg
int k2sg[s_lenJ][s_lenI]
Definition: HijJet2.h:57
HijJet2::lenJ
int lenJ() const
Definition: HijJet2.h:38
HijJet2::HIJJET2::pmsg
float pmsg[s_lenJ][s_lenI]
Definition: HijJet2.h:62
HijJet2::HijJet2
HijJet2()
Definition: HijJet2.h:80
HijJet2::lenI
int lenI() const
Definition: HijJet2.h:37
HijJet2::s_lenJ
static const int s_lenJ
Definition: HijJet2.h:45
HijJet2::iasg
int & iasg(int i, int k)
Definition: HijJet2.h:106
HijJet2::HIJJET2::pxsg
float pxsg[s_lenJ][s_lenI]
Definition: HijJet2.h:58
HijJet2::HIJJET2::iasg
int iasg[s_lenK][s_lenI]
Definition: HijJet2.h:55
HijJet2::pmsg
float & pmsg(int i, int j)
Definition: HijJet2.h:176
HijJet2::nsg
int & nsg(void)
Definition: HijJet2.h:91
lumiFormat.i
int i
Definition: lumiFormat.py:85
HijJet2::HIJJET2::pysg
float pysg[s_lenJ][s_lenI]
Definition: HijJet2.h:59
HijJet2::pxsg
float & pxsg(int i, int j)
Definition: HijJet2.h:136
HijJet2::~HijJet2
~HijJet2()
Definition: HijJet2.h:87
HijJet2::m_dummy
int m_dummy
Definition: HijJet2.h:65
HijJet2::k1sg
int & k1sg(int i, int j)
Definition: HijJet2.h:116
HijJet2::HIJJET2::pzsg
float pzsg[s_lenJ][s_lenI]
Definition: HijJet2.h:60
HijJet2::m_realdummy
float m_realdummy
Definition: HijJet2.h:66
HijJet2::HIJJET2::njsg
int njsg[s_lenI]
Definition: HijJet2.h:54
HijJet2::pysg
float & pysg(int i, int j)
Definition: HijJet2.h:146
hijjet2_address_
uintptr_t hijjet2_address_()
HijJet2::HIJJET2::nsg
int nsg
Definition: HijJet2.h:53
HijJet2::HIJJET2::pesg
float pesg[s_lenJ][s_lenI]
Definition: HijJet2.h:61
HijJet2::k2sg
int & k2sg(int i, int j)
Definition: HijJet2.h:126
HijJet2::pzsg
float & pzsg(int i, int j)
Definition: HijJet2.h:156
HijJet2
Class definition for HijJet2, which is used to modify the Hijing HIJJET2 common.
Definition: HijJet2.h:18
HijJet2::s_hijjet2
static HIJJET2 * s_hijjet2
Definition: HijJet2.h:68
fitman.k
k
Definition: fitman.py:528