00001 #ifndef __CINT__
00002 #include "IO/LCReader.h"
00003 #include "IOIMPL/LCFactory.h"
00004 #include "EVENT/MCParticle.h"
00005 #include "EVENT/LCCollection.h"
00006 #include "EVENT/LCEvent.h"
00007 #include "UTIL/LCTOOLS.h"
00008 #endif
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 void anajob(const char* FILEN) {
00019
00020
00021
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
00042 while( (evt = lcReader->readNextEvent()) != 0 ) {
00043
00044 UTIL::LCTOOLS::dumpEvent( evt ) ;
00045 nEvents ++ ;
00046 }
00047
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 }