#include "TFile.h"
#include "TTree.h"
#include "TBranch.h"
#include "TTreeReader.h"
#include "TTreeReaderValue.h"
Go to the source code of this file.
Definition at line 7 of file CountEvents.C.
13 TFile *
f = TFile::Open(
"http://lcg-heppkg.web.cern.ch/lcg-heppkg/ROOT/eventdata.root");
16 printf(
"Error: cannot open http://lcg-heppkg.web.cern.ch/lcg-heppkg/ROOT/eventdata.root!\n");
21 TTreeReader myReader(
"EventTree", f);
22 TTreeReaderValue<Int_t> eventSize(myReader,
"fEventSize");
25 while (myReader.Next()) {
28 totalSize += *eventSize;
31 Int_t sizeInMB = totalSize/1024/1024;
32 printf(
"Total size of all events: %d MB\n", sizeInMB);