27 void MakeHists(Char_t *xdffilename=
28 "/afs/rhic.bnl.gov/star/data/samples/gstar.dst.xdf")
33 if (strcmp(gSystem.GetName(),
"WinNT")==0){
35 if (gSystem.Load(
"St_base.dll")) printf(
" Loading DLL \"St_base.dll\" failed \n");
36 if (gSystem.Load(
"St_Tables.dll")) printf(
" Loading DLL \"St_Tables.dll\" failed \n");
39 if (gSystem.Load(
"St_base.so")) printf(
" Loading DLL \"St_base.so\" failed \n");
40 if (gSystem.Load(
"xdf2root.so")) printf(
" Loading DLL \"xdf2root.so\" failed \n");
41 if (gSystem.Load(
"St_Tables.so")) printf(
" Loading DLL \"St_Tables.so\" failed \n");
45 St_XDFFile xdf(xdffilename);
47 if (!event) { printf(
" NO events \n");
return;}
51 set = root.
Cd(
"/evgen/particle");
53 if (set && set->HasData()) {
54 St_particle *pa = (St_particle *)set;
57 printf(
" Checking the results \n");
61 printf(
" Name=%s type=%s t1_h.nok = %i \n", t1_h->
name, t1_h->
type, t1_h->
nok);
62 printf(
" t1_h.rbytes = %i \n", t1_h.
rbytes);
64 particle_st *particle = pa->GetTable();
70 TH1F *h1 =
new TH1F(
"h1",
"phep(3)",100);
75 TH1F *h1Sqrt=
new TH1F(
"h1Sqrt",
"666.sqrt",100);
80 TH1F *h2Log1=
new TH1F(
"h2Log1",
"666.log1",100);
81 h2Log1->SetFillColor(42);
85 TH1F *h3Log2=
new TH1F(
"h3Log2",
"666.log2",100);
86 h3Log2->SetFillColor(46);
90 Int_t kUPDATE = t1_h.
nok/20;
94 c1 =
new TCanvas(
"c1",
"The reading STAF table: \"particle.h\"",200,10,600,800);
96 gBenchmark->Start(
"hsum");
100 for (l=0; l < pa->GetNRows(); l++)
103 particle_st *p = particle[l];
107 h1->Fill(p->phep[2]);
119 if ( p->phep[0] != 0 )
121 h1Sqrt->Fill(::sqrt(p->phep[0]**2+p->phep[1]**2));
122 h2Log1->Fill(::sqrt(tan(0.5*atan(p->phep[2]/::sqrt(p->phep[0]**2+p->phep[1]**2))+.7854)));
128 if ( p->idhep ==211 || p->idhep == -211)
129 h3Log2->Fill(::log(tan(0.5*atan(p->phep[2]/::sqrt(p->phep[0]**2+p->phep[1]**2))+.7854)));
133 if (l && (l%kUPDATE) == 0) {
136 h2Log1->Draw(
"same");
138 h3Log2->Draw(
"same");
140 slider =
new TSlider(
"slider",
"test",1.05,0,1.1,h1Sqrt->GetMaximum()*1.3,38);
141 slider->SetFillColor(46);
143 if (slider) slider->SetRange(0,Float_t(l)/t1_h->
nok);
149 slider->SetRange(0,1);
151 gBenchmark->Show(
"hsum");
153 printf(
" This is a finish \n");
154 printf(
" You may pick up this example from /afs/rhic.bnl.gov/star/packages/dev/StRoot/macros/MakeHists.cxx\n");
virtual TDataSet * Cd(const Char_t *dirname)
virtual void ls(Option_t *option="") const