| The Gaudi Framework v29r1 (5cd95fa2)

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