Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HijJet2.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file HijJet2.h
1 
2 #ifndef HijJet2_h
3 #define HijJet2_h
4 
5 extern "C" { void* hijjet2_address_(void); }
12 class HijJet2 {
13 public:
14  HijJet2();
15  ~HijJet2();
16 
17  int& nsg (void);
18  int& njsg (int i);
19  int& iasg (int i, int k);
20  int& k1sg (int i, int j);
21  int& k2sg (int i, int j);
22  float& pxsg (int i, int j);
23  float& pysg (int i, int j);
24  float& pzsg (int i, int j);
25  float& pesg (int i, int j);
26  float& pmsg (int i, int j);
27 
28  void init (void);
29 
30  // return common array lengths
31  inline int lenI() const {return _lenI;}
32  inline int lenJ() const {return _lenJ;}
33  inline int lenK() const {return _lenK;}
34 
35 private:
36 
37  // Lengths of array in HiMain2 common
38  static const int _lenI = 900;
39  static const int _lenJ = 100;
40  static const int _lenK = 3;
41 
42  struct HIJJET2;
43  friend struct HIJJET2;
44 
45  struct HIJJET2
46  {
47  int nsg;
48  int njsg [_lenI];
49  int iasg [_lenK][_lenI];
50  int k1sg [_lenJ][_lenI];
51  int k2sg [_lenJ][_lenI];
52  float pxsg [_lenJ][_lenI];
53  float pysg [_lenJ][_lenI];
54  float pzsg [_lenJ][_lenI];
55  float pesg [_lenJ][_lenI];
56  float pmsg [_lenJ][_lenI];
57  };
58 
59  int _dummy;
60  float _realdummy;
61 
62  static HIJJET2* _hijjet2;
63 };
64 
65 // set pointer to zero at start
67 
68 inline void
70 { if (!_hijjet2) _hijjet2 = static_cast<HIJJET2*>(hijjet2_address_()); }
71 
72 // Constructor
73 inline
75  : _dummy (-999),
76  _realdummy (-999.)
77 {}
78 
79 // Destructor
80 inline
82 {}
83 
84 inline int&
86 {
87  init(); // check COMMON is initialized
88  return _hijjet2->nsg;
89 }
90 
91 inline int&
93 {
94  init(); // check COMMON is initialized
95  if(i < 1 || i > lenI()) return _dummy;
96  return _hijjet2->njsg[i-1];
97 }
98 
99 inline int&
100 HijJet2::iasg (int i, int k)
101 {
102  init(); // check COMMON is initialized
103  if( i < 1 || i > lenI() ||
104  k < 1 || k > lenK() ) return _dummy;
105 
106  return _hijjet2->iasg[k-1][i-1];
107 }
108 
109 inline int&
110 HijJet2::k1sg (int i, int j)
111 {
112  init(); // check COMMON is initialized
113  if( i < 1 || i > lenI() ||
114  j < 1 || j > lenJ() ) return _dummy;
115 
116  return _hijjet2->k1sg[j-1][i-1];
117 }
118 
119 inline int&
120 HijJet2::k2sg (int i, int j)
121 {
122  init(); // check COMMON is initialized
123  if( i < 1 || i > lenI() ||
124  j < 1 || j > lenJ() ) return _dummy;
125 
126  return _hijjet2->k2sg[j-1][i-1];
127 }
128 
129 inline float&
130 HijJet2::pxsg (int i, int j)
131 {
132  init(); // check COMMON is initialized
133  if( i < 1 || i > lenI() ||
134  j < 1 || j > lenJ() ) return _realdummy;
135 
136  return _hijjet2->pxsg[j-1][i-1];
137 }
138 
139 inline float&
140 HijJet2::pysg (int i, int j)
141 {
142  init(); // check COMMON is initialized
143  if( i < 1 || i > lenI() ||
144  j < 1 || j > lenJ() ) return _realdummy;
145 
146  return _hijjet2->pysg[j-1][i-1];
147 }
148 
149 inline float&
150 HijJet2::pzsg (int i, int j)
151 {
152  init(); // check COMMON is initialized
153  if( i < 1 || i > lenI() ||
154  j < 1 || j > lenJ() ) return _realdummy;
155 
156  return _hijjet2->pzsg[j-1][i-1];
157 }
158 
159 inline float&
160 HijJet2::pesg (int i, int j)
161 {
162  init(); // check COMMON is initialized
163  if( i < 1 || i > lenI() ||
164  j < 1 || j > lenJ() ) return _realdummy;
165 
166  return _hijjet2->pesg[j-1][i-1];
167 }
168 
169 inline float&
170 HijJet2::pmsg (int i, int j)
171 {
172  init(); // check COMMON is initialized
173  if( i < 1 || i > lenI() ||
174  j < 1 || j > lenJ() ) return _realdummy;
175 
176  return _hijjet2->pmsg[j-1][i-1];
177 }
178 
179 #endif