41 void Example_read_xdf_makehist(
42 const Char_t *InputXdfFile=
43 "/afs/rhic.bnl.gov/star/data/samples/gstar.dst.xdf")
46 gSystem.Load(
"St_base");
47 gSystem.Load(
"xdf2root");
48 gSystem->Load(
"libglobal_Tables");
49 gSystem->Load(
"libgen_Tables");
50 gSystem->Load(
"libsim_Tables");
55 f1.OpenXDF(InputXdfFile);
60 record = f1.NextEventGet();
67 TFile *hist_outfile = 0;
68 const Char_t *root_file =
"Example_read_xdf_makehist.root";
69 hist_outfile =
new TFile(root_file,
"RECREATE");
76 TH1F *h1 =
new TH1F(
"h1",
"z position of prim vtx",100,-100.,100.);
78 h1->SetXTitle(
"vertex z position ");
79 h1->SetYTitle(
"num events");
80 TH1F *h2 =
new TH1F(
"h2",
"z position of all vtx in event",100,-100.,100.);
81 h2->SetXTitle(
"vertex z position ");
82 h2->SetYTitle(
"num events");
90 while (recorde=f1.NextEventGet())
96 cout <<
" ==> event # " << ijk << endl;
102 sete = roote.Cd(
"/dst/vertex");
103 cout <<
" find vertex table pointer = " << sete << endl;
109 St_dst_vertex *pdt=0;
114 pdt = (St_dst_vertex *)sete;
118 cout <<
" table header info: name = " << pdt->GetName() << endl;
119 cout <<
" table header info: type = " << pdt->GetType() << endl;
120 cout <<
" table header info: #rows used = " << pdt->GetNRows() << endl;
121 cout <<
" table header info: #rows allocated = " << pdt->GetTableSize() << endl;
122 cout <<
" table header info: row size (bytes) = " << pdt->GetRowSize() << endl;
123 cout <<
" table header info: #columns = " << pdt->GetNumberOfColumns() << endl;
127 dst_vertex_st *tdt_v = pdt->GetTable();
129 cout <<
" prim vtx z : " << tdt_v->z << endl;
133 for (ij=0; ij< pdt->GetNRows(); ij++)
137 h2->Fill(tdt_v[ij]->z);
141 cout <<
" ==> finished loop" << endl;
144 TCanvas *c1 =
new TCanvas(
"c1",
" from table dst/vertex",200,10,600,880);
152 TPostScript ps(
"Example_read_xdf_makehist.ps",111);
162 hist_outfile->Write();
virtual void ls(Option_t *option="") const