StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rdFeeTTree.C
1 class EEfeeDataBlock;
2 class EEfeeRawEvent;
3 class EEfeeRunDescr;
4 
5 TFile *f;
6 
7 void rdFeeTTree(int max=200000) {
8  gSystem->Load("StRoot/StEEmcUtil/EEfeeRaw/libEEfeeRaw.so");
9 
10  TString fname="run00006.root";
11  fname="miniDaq/feb24/run00003.root";
12  fname="/star/u/eemcdb/ezdaqRead/fee.root";
13 
14  TFile *f = new TFile(fname);
15  TTree *t = (TTree *)f->Get("fee");
16  TBranch *bd = t->GetBranch("desc");
17  TBranch *be = t->GetBranch("evt");
18 
19  EEfeeRawEvent *eve = new EEfeeRawEvent();
20  EEfeeRunDescr *des = new EEfeeRunDescr();
21 
22  be->SetAddress(&eve);
23  bd->SetAddress(&des);
24 
25  Int_t nentries = (Int_t)t->GetEntries();
26  printf(" N entries=%d\n",nentries);
27  if(nentries<=0) {
28  printf(" file=%s is empty, STOP\n",fname.Data());
29  return;
30  }
31 
32  Int_t nbe=0;
33  Int_t nbd=0;
34  for(Int_t i=0; i<nentries; i++) {
35  nbe += be->GetEntry(i);
36  nbd += bd->GetEntry(i);
37  if(i%1000==0)des->print();
38  //eve->print();
39  if(i>=max) break;
40  }
41 
42 }
43 
44 
45