8 #include "EVENT/LCIO.h"
15 using namespace lcio ;
26 LCWriter* lcWrt{NULL} ;
36 lcWrt = LCFactory::getInstance()->createLCWriter() ;
38 try{ lcWrt->open( outFileName , LCIO::WRITE_NEW ) ; }
40 catch(IOException& e){
41 cout <<
"[RunEventProcessor()] Can't open file for writing - "
51 cout <<
endl <<
" " << nEvent <<
" events copied ! " <<
endl ;
59 lcWrt->writeEvent( evt ) ;
71 lcWrt->writeRunHeader( run ) ;
80 int main(
int argc,
char** argv ){
88 LCReader*
lcReader = LCFactory::getInstance()->createLCReader() ;
91 cout <<
"usage: copyfix infilename outfilename " <<
endl ;
95 inFileName = argv[1] ;
96 outFileName = argv[2] ;
99 try{ lcReader->open( inFileName ) ; }
101 catch( IOException& e){
102 cout <<
"Can't open file : " << e.what() <<
endl ;
111 lcReader->registerLCRunListener( &evtProc ) ;
112 lcReader->registerLCEventListener( &evtProc ) ;
114 lcReader->readStream() ;
void modifyEvent(LCEvent *)
Little tool that copies LCIO files on an event by event and run by run basis, thus fixing files that ...
void processEvent(LCEvent *evt)
RunEventProcessor(const char *outFileName)
int main(int argc, char **argv)
Simple program that opens existing LCIO files and appends the records needed for direct access - if t...
void processRunHeader(LCRunHeader *run)
void modifyRunHeader(LCRunHeader *)