StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
thmu.C
1 #ifndef __CINT__
2 #include <stdio.h>
3 #include "TSystem.h"
4 #include "TBenchmark.h"
5 #include "TFile.h"
6 #include "TTree.h"
7 #include "TH1.h"
8 #include "TCanvas.h"
9 #include "TTreeIter.h"
10 #endif
11 
12 TBranch *tb=0;
13 TFile *muFile =0;
14 TTree *muTree=0;
15 TH1F *hz=0;
16 TH1F *hx=0;
17 TH1F *ht=0;
18 TCanvas *c1=0;
19 
20 void th()
21 {
22 
23  TTreeIter th(muTree);
24  th.AddFile("test.MuDst.root");
25 // th.ls();
26 // return;
27  const int *&run = th("MuEvent.mEventInfo.mRunId");
28  const int *&evt = th("MuEvent.mEventInfo.mId");
29  const int& nGlobs = th("GlobalTracks");
30  printf("&run=%p &evt=%p\n",&run,&evt);
31  int n=0;
32  while (th.Next())
33  {
34  printf("serial = %d run=%d evt=%d nGlo = %d\n",n,*run,*evt,nGlobs);n++;
35  }
36 }