EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HijJet1.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file HijJet1.h
1 
2 #ifndef HijJet1_h
3 #define HijJet1_h
4 
5 extern "C" { void* hijjet1_address_(void); }
10 class HijJet1 {
11 public:
12  HijJet1();
13  ~HijJet1();
14 
15  int& npj (int i);
16  int& kfpj (int i, int j);
17  float& pjpx (int i, int j);
18  float& pjpy (int i, int j);
19  float& pjpz (int i, int j);
20  float& pjpe (int i, int j);
21  float& pjpm (int i, int j);
22  int& ntj (int i);
23  int& kftj (int i, int j);
24  float& pjtx (int i, int j);
25  float& pjty (int i, int j);
26  float& pjtz (int i, int j);
27  float& pjte (int i, int j);
28  float& pjtm (int i, int j);
29 
30  void init (void);
31 
32  // return common array lengths
33  inline int lenI() const {return _lenI;}
34  inline int lenJ() const {return _lenJ;}
35 
36 private:
37 
38  // Lengths of array in HiMain2 common
39  static const int _lenI = 300;
40  static const int _lenJ = 500;
41 
42  struct HIJJET1;
43  friend struct HIJJET1;
44 
45  struct HIJJET1
46  {
47  int npj [_lenI];
48  int kfpj [_lenJ][_lenI];
49  float pjpx [_lenJ][_lenI];
50  float pjpy [_lenJ][_lenI];
51  float pjpz [_lenJ][_lenI];
52  float pjpe [_lenJ][_lenI];
53  float pjpm [_lenJ][_lenI];
54  int ntj [_lenI];
55  int kftj [_lenJ][_lenI];
56  float pjtx [_lenJ][_lenI];
57  float pjty [_lenJ][_lenI];
58  float pjtz [_lenJ][_lenI];
59  float pjte [_lenJ][_lenI];
60  float pjtm [_lenJ][_lenI];
61  };
62 
63  int _dummy;
64  float _realdummy;
65 
66  static HIJJET1* _hijjet1;
67 };
68 
69 // set pointer to zero at start
71 
72 inline void
74 { if (!_hijjet1) _hijjet1 = static_cast<HIJJET1*>(hijjet1_address_()); }
75 
76 // Constructor
77 inline
79  : _dummy (-999),
80  _realdummy (-999.)
81 {}
82 
83 // Destructor
84 inline
86 {}
87 
88 inline int&
89 HijJet1::npj (int i)
90 {
91  init(); // check COMMON is initialized
92  if(i < 1 || i > lenI()) return _dummy;
93  return _hijjet1->npj[i-1];
94 }
95 
96 inline int&
97 HijJet1::kfpj (int i, int j)
98 {
99  init(); // check COMMON is initialized
100  if( i < 1 || i > lenI() ||
101  j < 1 || j > lenJ() ) return _dummy;
102 
103  return _hijjet1->kfpj[j-1][i-1];
104 }
105 
106 inline float&
107 HijJet1::pjpx (int i, int j)
108 {
109  init(); // check COMMON is initialized
110  if( i < 1 || i > lenI() ||
111  j < 1 || j > lenJ() ) return _realdummy;
112 
113  return _hijjet1->pjpx[j-1][i-1];
114 }
115 
116 inline float&
117 HijJet1::pjpy (int i, int j)
118 {
119  init(); // check COMMON is initialized
120  if( i < 1 || i > lenI() ||
121  j < 1 || j > lenJ() ) return _realdummy;
122 
123  return _hijjet1->pjpy[j-1][i-1];
124 }
125 
126 inline float&
127 HijJet1::pjpz (int i, int j)
128 {
129  init(); // check COMMON is initialized
130  if( i < 1 || i > lenI() ||
131  j < 1 || j > lenJ() ) return _realdummy;
132 
133  return _hijjet1->pjpz[j-1][i-1];
134 }
135 
136 inline float&
137 HijJet1::pjpe (int i, int j)
138 {
139  init(); // check COMMON is initialized
140  if( i < 1 || i > lenI() ||
141  j < 1 || j > lenJ() ) return _realdummy;
142 
143  return _hijjet1->pjpe[j-1][i-1];
144 }
145 
146 inline float&
147 HijJet1::pjpm (int i, int j)
148 {
149  init(); // check COMMON is initialized
150  if( i < 1 || i > lenI() ||
151  j < 1 || j > lenJ() ) return _realdummy;
152 
153  return _hijjet1->pjpm[j-1][i-1];
154 }
155 
156 inline int&
158 {
159  init(); // check COMMON is initialized
160  if(i < 1 || i > lenI()) return _dummy;
161  return _hijjet1->ntj[i-1];
162 }
163 
164 inline int&
165 HijJet1::kftj (int i, int j)
166 {
167  init(); // check COMMON is initialized
168  if( i < 1 || i > lenI() ||
169  j < 1 || j > lenJ() ) return _dummy;
170 
171  return _hijjet1->kftj[j-1][i-1];
172 }
173 
174 inline float&
175 HijJet1::pjtx (int i, int j)
176 {
177  init(); // check COMMON is initialized
178  if( i < 1 || i > lenI() ||
179  j < 1 || j > lenJ() ) return _realdummy;
180 
181  return _hijjet1->pjtx[j-1][i-1];
182 }
183 
184 inline float&
185 HijJet1::pjty (int i, int j)
186 {
187  init(); // check COMMON is initialized
188  if( i < 1 || i > lenI() ||
189  j < 1 || j > lenJ() ) return _realdummy;
190 
191  return _hijjet1->pjty[j-1][i-1];
192 }
193 
194 inline float&
195 HijJet1::pjtz (int i, int j)
196 {
197  init(); // check COMMON is initialized
198  if( i < 1 || i > lenI() ||
199  j < 1 || j > lenJ() ) return _realdummy;
200 
201  return _hijjet1->pjtz[j-1][i-1];
202 }
203 
204 inline float&
205 HijJet1::pjte (int i, int j)
206 {
207  init(); // check COMMON is initialized
208  if( i < 1 || i > lenI() ||
209  j < 1 || j > lenJ() ) return _realdummy;
210 
211  return _hijjet1->pjte[j-1][i-1];
212 }
213 
214 inline float&
215 HijJet1::pjtm (int i, int j)
216 {
217  init(); // check COMMON is initialized
218  if( i < 1 || i > lenI() ||
219  j < 1 || j > lenJ() ) return _realdummy;
220 
221  return _hijjet1->pjtm[j-1][i-1];
222 }
223 
224 #endif