StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mevsimtest.C
1 {
2  // Delete the "old" log file
3  gSystem.Exec("rm *.log");
4 
5 printf(" Creating the tables \n");
6 
7  St_particle *pa = new St_particle(30000);
8 
9 printf(" Calling the 'mevsim' module \n");
10 
11  mevsim(pa);
12 
13 printf(" Checking the results \n");
14 
15  table_head_st *t1_h = pa.GetHeader();
16 
17 printf(" Name=%s type=%s t1_h.nok = %i \n", t1_h->name, t1_h->type, t1_h->nok);
18 printf(" t1_h.rbytes = %i \n", t1_h.rbytes);
19 
20  hfile = new TFile("mevsim.root","RECREATE","mevsim simulation");
21  particle_st *particle = pa.GetTable();
22 
23 // Create "ntuple"
24 
25  TNtuple *ntuple = new TNtuple("ntuple","Demo ntuple","idhep:p1:p2:p3:p4:p5");
26 
27 // Fill "Ntuple"
28 printf(" Filling ntuple \n");
29 
30  for ( Int_t l=0; l<t1_h.nok; l++)
31  {
32  ntuple->Fill(particle[l]->idhep
33  ,particle[l]->phep[0]
34  ,particle[l]->phep[1]
35  ,particle[l]->phep[2]
36  ,particle[l]->phep[3]
37  ,particle[l]->phep[4]
38  );
39  }
40 
41 // Show some results
42 
43 printf(" some KUMACS like results to show \n");
44 
45 //*-*
46 //*-* nt/plot 666.phep(3) \n");
47 //
48  ntuple->Draw("p3");
49 
50 //*-*
51 //*-* nt/plot 666.sqrt(phep(1)**2+phep(2)**2) (0.ne.phep(1))
52 //
53  ntuple->Draw("sqrt(p1**2+p2**2)", "p1 != 0");
54 
55 //*-*
56 //*-* nt/plot 666.log(tan(0.5*atan(phep(3)/sqrt(phep(1)**2+phep(2)**2))+.7854)) (0.ne.phep(1))
57 //
58  ntuple->Draw("log(tan(0.5*atan(p3/sqrt(p1**2+p2**2))+.7854))", "p1 != 0");
59 
60 //*-*
61 //*-* 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");
62 //
63  ntuple->Draw("log(tan(0.5*atan(p3/sqrt(p1**2+p2**2))+.7854))", "idhep == 211 || idhep==-211");
64 
65 hfile->Write();
66 
67 }
char type[20]
Definition: table_header.h:13
char name[20]
Definition: table_header.h:12