| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

NTupleInfo.h
Go to the documentation of this file.
1 #ifdef __cplusplus
2
3 #ifndef HBOOKCNV_NTUPLEINFO_H
4 #define HBOOKCNV_NTUPLEINFO_H 1
5
6 #include "GaudiKernel/Kernel.h"
7 #include "GaudiKernel/NTuple.h"
8
9 class NTUPLEINFO {
10 public:
11 long id;
12 char title[128];
13 char rzdir[256];
14 long numEnt;
15 long numVar;
16 char block[32];
17
18 // struct _var {
19 char name[512][64];
20 long dim[512];
21 long theDim[512][5];
22 long hasIndex[512];
23 char index[512][64];
24 char type[512];
25 long size[512];
26 long hasRange[512];
27 long irange[512][2];
28 double frange[512][2];
29 template <class TYPE>
30 void getBounds(long i, TYPE& min, TYPE& max, TYPE& null) const {
31 if ( hasRange[i] ) {
32 min = (type[i]=='R') ? TYPE(frange[i][0]) : TYPE(irange[i][0]);
33 max = (type[i]=='R') ? TYPE(frange[i][1]) : TYPE(irange[i][1]);
34 }
35 else {
36 min = NTuple::Range<TYPE>::min();
37 max = NTuple::Range<TYPE>::max();
38 }
39 null = TYPE(0);
40 }
41 TEMPLATE_SPECIALIZATION
42 void getBounds(long /*i*/, bool& min, bool& max, bool& null ) const {
43 min = null = false;
44 max = true;
45 }
46 template <class TYPE>
47 bool isRangeWithin(long i, TYPE min, TYPE max) const {
48 if ( hasRange[i] ) {
49 return min <= (TYPE)irange[i][0] && (TYPE)irange[i][1] <= max;
50 }
51 else if ( type[i] == 'I' || type[i] == 'U' ) {
52 return NTuple::Range<TYPE>::min() <= min && NTuple::Range<TYPE>::max() >= max;
53 }
54 return false;
55 }
56 TEMPLATE_SPECIALIZATION
57 bool isRangeWithin(long i, float /* min */, float /* max*/ ) const {
58 if ( size[i] == 32 ) return true;
59 return false;
60 }
61 TEMPLATE_SPECIALIZATION
62 bool isRangeWithin(long i, double /* min */, double /* max */ ) const {
63 if ( size[i] == 64 ) return true;
64 return false;
65 }
66 TEMPLATE_SPECIALIZATION
67 bool isRangeWithin(long /* i */ , bool min, bool max) const {
68 return min == false && max == true;
69 }
70 long idist(long i) const {
71 return irange[i][1] - irange[i][0];
72 }
73 double fdist(long i) const {
74 return frange[i][1] - frange[i][0];
75 }
76 // } var[512];
77
78 long getIndex(const char* nam) const {
79 if ( nam[0] != 0 ) {
80 for ( int i = 0; i < numVar; i++ ) {
81 if ( strncmp(name[i], nam, sizeof(name[i])) == 0 ) {
82 return i;
83 }
84 }
85 }
86 return -1;
87 }
88 };
89 #endif // HBOOKCNV_NTUPLEINFO_H
90
91 #else
92 #ifdef _WIN32
93 STRUCTURE /NTUPLEVAR/
94 CHARACTER*64 NAME
95 INTEGER NDIM
96 INTEGER THEDIM(5)
97 INTEGER HASINDEX
98 CHARACTER*64 INDEX
99 CHARACTER*1 TYPE
100 INTEGER SIZE
101 INTEGER HASRANGE
102 UNION
103 MAP
104 INTEGER IMIN, IMAX
105 END MAP
106 MAP
107 REAL*8 FMIN, FMAX
108 END MAP
109 END UNION
110 END STRUCTURE
111
112 STRUCTURE /NTUPLEINFO/
113 INTEGER ID
114 CHARACTER*128 TITLE
115 INTEGER NOENT
116 INTEGER NDIM
117 CHARACTER*8 BLOCK
118 RECORD /NTUPLEVAR/ VAR(512)
119 END STRUCTURE
120 #else
121 c TYPE NTUPLEVAR
122 CHARACTER*64 VNAME(512)
123 INTEGER VNDIM(512)
124 INTEGER VTHEDIM(512,5)
125 INTEGER VHASINDEX(512)
126 CHARACTER*64 VINDEX(512)
127 CHARACTER*1 VTYPE(512)
128 INTEGER VSIZE(512)
129 INTEGER VHASRANGE(512)
130 c UNION
131 c MAP
132 INTEGER VIMIN(512), VIMAX(512)
133 c END MAP
134 c MAP
135 REAL*8 VFMIN(512), VFMAX(512)
136 c END MAP
137 c END UNION
138 c END TYPE NTUPLEVAR
139
140 c TYPE NTUPLEINFO
141 INTEGER NTID
142 CHARACTER*128 NTTITLE
143 INTEGER NTNOENT
144 INTEGER NTNDIM
145 CHARACTER*8 NTBLOCK
146 c TYPE(NTUPLEVAR) VAR(512)
147 c END TYPE NTUPLEINFO
148 COMMON/NTUPLEINFO/VNAME,VNDIM,VTHEDIM,
149 & VHASINDEX,VINDEX,VTYPE,VSIZE,
150 & VHASRANGE, VIMIN, VIMAX, VFMIN, VFMAX,
151 & NTID, NTTITLE, NTNDIM, NTBLOCK
152 #endif
153 #endif
Kernel.h
NTTITLE
c TYPE NTUPLEVAR CHARACTER INTEGER NTTITLE
Definition: NTupleInfo.h:148
gaudirun.c
c
Definition: gaudirun.py:391
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
VSIZE
c TYPE NTUPLEVAR CHARACTER INTEGER VSIZE
Definition: NTupleInfo.h:148
NTuple.h
NTuple::Range::min
static TYP min()
Minimal number of data.
Definition: NTuple.h:76
VTHEDIM
c TYPE NTUPLEVAR CHARACTER INTEGER VTHEDIM
Definition: NTupleInfo.h:148
VTYPE
c TYPE NTUPLEVAR CHARACTER INTEGER VTYPE
Definition: NTupleInfo.h:148
NTID
c TYPE NTUPLEVAR CHARACTER INTEGER & NTID
Definition: NTupleInfo.h:148
VNDIM
c TYPE NTUPLEVAR CHARACTER INTEGER VNDIM
Definition: NTupleInfo.h:148
gaudirun.type
type
Definition: gaudirun.py:125
VINDEX
c TYPE NTUPLEVAR CHARACTER INTEGER VINDEX
Definition: NTupleInfo.h:148
NTuple::Range::max
static TYP max()
Maximal number of data.
Definition: NTuple.h:78
VIMAX
c TYPE NTUPLEVAR CHARACTER INTEGER VIMAX
Definition: NTupleInfo.h:148
VNAME
c TYPE NTUPLEVAR CHARACTER * VNAME(512) INTEGER VNDIM(512) INTEGER VTHEDIM(512
VIMIN
c TYPE NTUPLEVAR CHARACTER INTEGER VIMIN
Definition: NTupleInfo.h:148
VFMAX
c TYPE NTUPLEVAR CHARACTER INTEGER VFMAX
Definition: NTupleInfo.h:148
std::strncmp
T strncmp(T...args)
VFMIN
c TYPE NTUPLEVAR CHARACTER INTEGER VFMIN
Definition: NTupleInfo.h:148
VHASRANGE
c TYPE NTUPLEVAR CHARACTER INTEGER & VHASRANGE
Definition: NTupleInfo.h:148
NTNDIM
c TYPE NTUPLEVAR CHARACTER INTEGER NTNDIM
Definition: NTupleInfo.h:148
VHASINDEX
c TYPE NTUPLEVAR CHARACTER INTEGER & VHASINDEX
Definition: NTupleInfo.h:148