StRoot
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
macros
test
dataset
testTable.C
1
{
2
// Copyright(c) 2001 [BNL] Brookhaven National Laboratory, Valeri Fine (fine@bnl.gov). All right reserved",
3
// TGenericTable and TIndexTable test macro
4
int
problemCounter = 0;
5
gSystem->Load(
"libGeom"
);
6
gSystem->Load(
"libTable"
);
7
struct
hit
{
8
float
energy;
/* energy */
9
int
detectorId;
/* geometry id */
10
};
11
12
TGenericTable
*allHits =
new
TGenericTable
(
"hit"
,
"hits"
,1000);
13
allHits->
Print
();
14
hit
a;
15
memset(&a,0,
sizeof
(a));
16
int
i = 0;
17
for
(i=0; i<5; i++) {
18
a.energy = sin(i*0.1);
19
a.detectorId = i;
20
allHits->
AddAt
(&a);
21
}
22
allHits->
Print
();
23
// Draw the histogram for the selected column
24
allHits->Draw(
"energy"
);
25
}
26
TGenericTable
Definition:
TGenericTable.h:18
TTable::AddAt
virtual Int_t AddAt(const void *c)
Definition:
TTable.cxx:1122
hit
Definition:
GenericTable.C:6
TTable::Print
virtual Char_t * Print(Char_t *buf, Int_t n) const
Create IDL table defintion (to be used for XDF I/O)
Definition:
TTable.cxx:1548
Generated by
1.8.5