10 #include "TEventList.h"
11 #include "TDirectory.h"
25 int uid(
int lev,
int lrun,
int lmode)
27 return lev+10000*lrun+(((lmode/100)%10)*20+lmode%10)*100000;
34 TFile *
f=
new TFile(fname,
"READ");
35 TTree *
t=(TTree*)f->Get(ntp);
38 TEventList *el = (TEventList*)gDirectory->Get(
"el");
40 t->SetBranchAddress(
"ev",&
ev);
41 t->SetBranchAddress(
"run",&
run);
42 t->SetBranchAddress(
"mode",&
mode);
43 t->SetBranchAddress(
"recmode",&
rec);
45 t->SetBranchStatus(
"*",0);
46 t->SetBranchStatus(
"ev",1);
47 t->SetBranchStatus(
"run",1);
48 t->SetBranchStatus(
"mode",1);
49 t->SetBranchStatus(
"recmode",1);
53 for (
int i=0;
i<el->GetN();++
i)
55 t->GetEntry(el->GetEntry(
i));
58 t->SetBranchStatus(
"*",1);
60 printf(
"EVT = %d CAND = %d\n",
evcnt.size(), el->GetN());
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
int countevents(TString fname, TString ntp, TString cut)
int uid(int lev, int lrun, int lmode)
std::map< int, int > CountMap
std::map< int, int > CountMap