| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

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

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ) {
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