StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
test8.C
1 {
2 // #include "St_mevsim_Module.h"
3 // void mevsimtest()
4  // Delete the "old" log file
5  gSystem.Exec("del *.log");
6 
7 // Read XDF file
8  St_XDFFile xdf("/star/mds/data/SD98/auau200/evg/central/hijing/set0001/regular/auau_ce_b0-2_4801_5000.xdf");
9  St_Event *event = xdf.NextEvent();
10  event->ls("*");
11  St_DataSet *set=0;
12  TList *list = event->GetListOfDataset();
13  TIter next(list);
14  set = (St_DataSet *)(next());
15  set->ls("*");
16  printf(" Getting the tables \n");
17  St_particle *pa=(St_particle *)(set->GetStafTable());
18 
19 // printf(" Calling the 'mevsim' module \n");
20 
21 // mevsim(pa);
22 
23 printf(" Checking the results \n");
24 
25  table_head_st *t1_h = pa.GetHeader();
26 
27 printf(" Name=%s type=%s t1_h.nok = %i \n", t1_h->name, t1_h->type, t1_h->nok);
28 printf(" t1_h.rbytes = %i \n", t1_h.rbytes);
29 
30  hfile = new TFile("mevsim.root","RECREATE","mevsim simulation");
31  particle_st *particle = pa.GetTable();
32 
33 // Create "ntuple"
34 
35  TNtuple *ntuple = new TNtuple("ntuple","Demo ntuple","idhep:p1:p2:p3:p4:p5");
36 
37 // Fill "Ntuple"
38 printf(" Filling ntuple \n");
39 
40  for ( Int_t l=0; l<t1_h.nok; l++)
41  {
42  ntuple->Fill(particle[l]->idhep
43  ,particle[l]->phep[0]
44  ,particle[l]->phep[1]
45  ,particle[l]->phep[2]
46  ,particle[l]->phep[3]
47  ,particle[l]->phep[4]
48  );
49  }
50 
51 // Show some results
52 
53 printf(" some KUMACS like results to show \n");
54 
55 //*-*
56 //*-* nt/plot 666.phep(3) \n");
57 //
58  TCanvas cp3("cp3");
59  ntuple->Draw("p3");
60 
61 //*-*
62 //*-* nt/plot 666.sqrt(phep(1)**2+phep(2)**2) (0.ne.phep(1))
63 //
64  TCanvas cp4("cp4");
65  ntuple->Draw("sqrt(p1**2+p2**2)", "p1 != 0");
66 
67 //*-*
68 //*-* nt/plot 666.log(tan(0.5*atan(phep(3)/sqrt(phep(1)**2+phep(2)**2))+.7854)) (0.ne.phep(1))
69 //
70  TCanvas cp5("cp5");
71  ntuple->Draw("log(tan(0.5*atan(p3/sqrt(p1**2+p2**2))+.7854))", "p1 != 0");
72 
73 //*-*
74 //*-* nt/plot 666.log(tan(0.5*atan(phep(3)/sqrt(phep(1)**2+phep(2)**2))+.7854)) (idhep.eq.211.or.idhep.eq.-211)\n");
75 //
76  TCanvas cp6("cp6");
77  ntuple->Draw("log(tan(0.5*atan(p3/sqrt(p1**2+p2**2))+.7854))", "idhep == 211 || idhep==-211");
78 
79 hfile->Write();
80 
81 }
char type[20]
Definition: table_header.h:13
virtual void ls(Option_t *option="") const
Definition: TDataSet.cxx:495
char name[20]
Definition: table_header.h:12