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
StEEmcUtil
macros
wrTree.C
1
2
wrTree(){
3
4
gSystem->Load(
"EEmc.so"
);
5
6
//create a Tree file tree4.root
7
TFile f(
"tree4.root"
,
"RECREATE"
);
8
9
// Create a ROOT Tree
10
TTree t4(
"t4"
,
"A Tree with Events"
);
11
12
// Create a pointer to an Event object
13
EEevent *
event
=
new
EEevent();
14
15
// Create DST for sectors
16
int
is;
17
for
(is=0;is<2;is++)
18
event->addSectorDst(is+5);
19
20
21
// Create two branches, split one.
22
t4.Branch(
"EEDst"
,
"EEevent"
, &event,16000,99);
23
// return;
24
25
for
(Int_t ev = 0; ev <3; ev++) {
26
27
event
->clear();
// Clear the event before reloading it
28
event
->setID(ev+80);
29
for
(is=0;is<2;is++) {
30
int
secID=is+5;
31
32
EEsectorDst
*sec= (
EEsectorDst
*)event->getSec(secID);
33
34
int
ih;
35
int
nh=100- ev*10-is;
36
for
(ih=0;ih<nh;ih++) {
37
float
energy=100+ih*100+nh;
38
// printf("bb=%d\n",ih);
39
sec->addTwHit(
'A'
,1,energy);
40
}
41
}
42
43
// Fill the tree
44
t4.Fill();
45
}
// end of loop over events
46
47
48
// Write the file header
49
f.Write();
50
51
// Print the tree contents
52
t4.Print();
53
}
EEsectorDst
Definition:
EEsectorDst.h:53
Generated by
1.8.5