ATLAS Offline Software
Loading...
Searching...
No Matches
HijCrdn.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 HijCrdn_h
7#define HijCrdn_h
8
9#include <cstdint>
10
11extern "C" { uintptr_t hijcrdn_address_(); }
17class HijCrdn {
18public:
19 HijCrdn();
20 ~HijCrdn();
21
22 float& yp (int i, int j);
23 float& yt (int i, int j);
24
25 void init (void);
26
27 // return common array lengths
28 inline int lenI() const {return s_lenI;}
29 inline int lenJ() const {return s_lenJ;}
30
31private:
32
33 // Lengths of array in HiMain2 common
34 static const int s_lenI = 3;
35 static const int s_lenJ = 300;
36
37 struct HIJCRDN;
38 friend struct HIJCRDN;
39
40 struct HIJCRDN
41 {
42 float yp [s_lenJ][s_lenI];
43 float yt [s_lenJ][s_lenI];
44 };
45
47
49};
50
51// set pointer to zero at start
53
54inline void
56{ if (!s_hijcrdn) s_hijcrdn = reinterpret_cast<HIJCRDN*>(hijcrdn_address_()); }
57
58// Constructor
59inline
61 : m_realdummy (-999.)
62{}
63
64// Destructor
65inline
68
69inline float&
70HijCrdn::yp (int i, int j)
71{
72 init(); // check COMMON is initialized
73 if( i < 1 || i > lenI() ||
74 j < 1 || j > lenJ() ) return m_realdummy;
75
76 return s_hijcrdn->yp[j-1][i-1];
77}
78
79inline float&
80HijCrdn::yt (int i, int j)
81{
82 init(); // check COMMON is initialized
83 if( i < 1 || i > lenI() ||
84 j < 1 || j > lenJ() ) return m_realdummy;
85
86 return s_hijcrdn->yt[j-1][i-1];
87}
88
89#endif
uintptr_t hijcrdn_address_()
#define yt
static const int s_lenJ
Definition HijCrdn.h:35
static const int s_lenI
Definition HijCrdn.h:34
void init(void)
Definition HijCrdn.h:55
float & yt(int i, int j)
Definition HijCrdn.h:80
int lenI() const
Definition HijCrdn.h:28
static HIJCRDN * s_hijcrdn
Definition HijCrdn.h:48
float m_realdummy
Definition HijCrdn.h:46
int lenJ() const
Definition HijCrdn.h:29
float & yp(int i, int j)
Definition HijCrdn.h:70
HijCrdn()
Definition HijCrdn.h:60
~HijCrdn()
Definition HijCrdn.h:66
float yt[s_lenJ][s_lenI]
Definition HijCrdn.h:43
float yp[s_lenJ][s_lenI]
Definition HijCrdn.h:42