#include "IO/LCReader.h"
#include "IOIMPL/LCFactory.h"
#include "EVENT/MCParticle.h"
#include "EVENT/LCCollection.h"
#include "EVENT/LCEvent.h"
#include "UTIL/LCTOOLS.h"
Include dependency graph for anajob.C:
Go to the source code of this file.
Functions | |
void | anajob (const char *FILEN) |
void anajob | ( | const char * | FILEN | ) |
Example script for testing the ROOT LCIO dictionary.
anajob: reads *.slcio file and dumps events to the screen in a ROOT macro.
Definition at line 18 of file anajob.C.
00018 { 00019 00020 00021 //just in case this script is executed multiple times 00022 delete gROOT->GetListOfFiles()->FindObject( FILEN ); 00023 delete gROOT->GetListOfCanvases()->FindObject("c1"); 00024 00025 00026 if (!TClassTable::GetDict("IMPL::ReconstructedParticleImpl")) { 00027 unsigned res ; 00028 00029 res = gSystem->Load("${LCIO}/lib/liblcio.so"); 00030 res = gSystem->Load("${LCIO}/lib/liblcioDict.so"); 00031 } 00032 00033 std::cout << " loaded LCIO library and dictionary ... " << std::endl ; 00034 00035 00036 int nEvents = 0 ; 00037 IO::LCReader* lcReader = IOIMPL::LCFactory::getInstance()->createLCReader() ; 00038 lcReader->open( FILEN ) ; 00039 00040 00041 //----------- the event loop ----------- 00042 while( (evt = lcReader->readNextEvent()) != 0 ) { 00043 00044 UTIL::LCTOOLS::dumpEvent( evt ) ; 00045 nEvents ++ ; 00046 } 00047 // -------- end of event loop ----------- 00048 00049 std::cout << std::endl 00050 << " " << nEvents 00051 << " events read from file: " 00052 << FILEN << std::endl ; 00053 00054 00055 lcReader->close() ; 00056 00057 delete lcReader ; 00058 }