#include <algorithm>
#include <map>
#include <utility>
#include <iostream>
#include "TFile.h"
#include "TTree.h"
#include "TString.h"
#include "TROOT.h"
#include "TEventList.h"
#include "TDirectory.h"
Go to the source code of this file.
Definition at line 32 of file countevents.C.
References ev, evcnt, f, i, mode, printf(), rec, run, t, and uid().
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 uid(int lev, int lrun, int lmode)
int uid |
( |
int |
lev, |
|
|
int |
lrun, |
|
|
int |
lmode |
|
) |
| |
Definition at line 25 of file countevents.C.
27 return lev+10000*lrun+(((lmode/100)%10)*20+lmode%10)*100000;